angularjs - Using Angular JS ng-csp directive to build privileged Firefox OS apps -
i member of team in charge of building packaged firefox os application. due restricted csp policy firefox os privileged applications i’ve added ng-csp directive body of application:
<body ng-app="the-app" ng-csp>
the csp specification firefox os privileged apps is: default-src *; script-src 'self'; object-src 'none'; style-src 'self' 'unsafe-inline'
according logs can firefox os device angular seems calling eval() or function() constructor , both blocked in firefox os privileged apps , app stops rendering.
i know if expected behavior, known issue or applying directive incorrectly?
anyone similar problem?
thanks in advance.
angular version: v1.0.1
error log:
05-07 19:31:10.048: error/geckoconsole(1397): [javascript error: "csp error: couldn't parse invalid source 'unsafe-inline'"] 05-07 19:31:10.048: error/geckoconsole(1397): [javascript warning: "csp warn: failed parse unrecognized source 'unsafe-inline'"]
<-- dropped css tags -->
05-07 19:31:13.892: error/geckoconsole(1397): [javascript error: "error: call function() blocked csp" {file: "app://788ceebd-a9b7-4a98-a8b0-1ff248e40f52/scripts/vendor/d10639ae.angular.js" line: 6337}] 05-07 19:31:13.912: error/geckoconsole(1397): [javascript warning: "csp warn: directive eval script base restriction violated" {file: "app://788ceebd-a9b7-4a98-a8b0-1ff248e40f52/scripts/vendor/d10639ae.angular.js" line: 6337 column: 0 source: "call eval() or related function blocked csp"}]
i've managed spot cause of problem. apparently angular calls function constructor in csp-safe mode (ng-csp) if attempt create watcher in $rootscope of application. i’ve made post in angular google groups since appears bug. i’ve made modification in angular js library , got working on firefox os device. link post following:
cheers
Comments
Post a Comment