Search code examples
web-applicationspolymerfirefox-oscontent-security-policy

Using Polymer in priviledged Firefox OS


I'm developing a small webapp for Firefox OS using Polymer. Everything is working properlery, until I set the webapp's type in the manifest to "priviledged". Then, Polymer isn't computed. There's an error in the console:

Content Security Policy: The page's settings blocked the loading of a resource at data:text/javascript;charset=utf-8...

Am I not allowed to load external scripts? Or do I something wrong?

Thanks in advance!


Solution

  • Privileged apps are packaged apps that needs to be signed by a trusted party (Firefox Marketplace so far) and all its code is supposed to be contained in the app package. So you cannot load external scripts from a privileged app.

    Check the CSP documentation. Note the script-src 'self'; part.

    You'll need to put Polymer scripts inside you app's package.

    If you are just testing locally and you are not planning to distribute your app, you can disable the CSP restrictions by setting this preference in your device:

    pref("security.apps.privileged.CSP.default", "default-src *; script-src *; object-src 'none'; style-src *");