使用 AngularJS 的 Firefox 插件 - "ng-src" 不工作

Firefox addon using AngularJS - "ng-src" not working

我正在开发一个使用 AngularJS 的 Firefox 插件。 问题在于 'ng-src'。它不会加载引用的图像。 当我切换到 'src' 时,图像加载正常。

Example.html 和 'icon-32.png' 在同一个文件夹中。

感谢您帮助我们理解这个问题。

下面是代码片段。

Example.html

<html ng-app="MyAddon" ng-csp>
    <head>
    </head>
    <body ng-controller="MainCtrl" dir="{{dirr}}">
        <div border="0">
            <img ng-src="{{logo}}" width="32" align="center">
            <input id="textbox" type="text"> </input>
            <button id="textboxbutton" type="button"> {{ButtonText}}</button>
        </div>

    <script src="lib/angular.min.js"></script>
    <script src="scripts/app.js"></script>
    </body>
</html>

app.js:

function MainController($scope) {
    $scope.ButtonText= 'Hit me!';
    $scope.dirr = 'rtl';
    $scope.logo= 'icon-32.png';
};

var MyModule = angular.module('MyAddon', [])
.controller('MainCtrl', MainController)

这是因为 angular 不断将 unsafe: 添加到您的图像 url。我认为这是解决方案,请尝试:Angular changes urls to "unsafe:" in extension page

并将 resource:// url 列入白名单。没有 unsafe: 它有效。

我在使用 DOM Inspector 时看到了这个: