Firefox WebExtensions and Cross-Domain Privileges

I am trying to port the chrome extension to firefox using the relatively new WebExtensions from Firefox.

I always get the following error

Cross-request request is blocked: A policy of the same origin prohibits reading the remote resource in ... (Reason: CORS header "Access-Control-Allow-Origin" is missing)

I added a website on which I would like to access the permissions section inside manifest.json, as described on the website, as well as in Google Chrome, where it works.

Usually it should work this way, at least explained that way at https://developer.mozilla.org/en-US/Add-ons/WebExtensions/Content_scripts#Cross-domain_privileges

I would be very grateful for any help as I have no ideas.

+4
source share
2 answers
manifest.json
{
  ... 
  "permissions": [
    "<all_urls>" 
  ]
}
+9
source

I think you need to add the CSP header to your HTML page. http://content-security-policy.com/ I had to add it to make mine work with a similar warning.

0
source

All Articles