10

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

I always getting the following error

Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource at .... (Reason: CORS header 'Access-Control-Allow-Origin' missing)

I added the website i would like to access to the permissions section inside the manifest.json like explained on the website, and also on Google Chrome its working.

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

I would be very thankful for any help since I am out of ideas.

Suever
  • 64,497
  • 14
  • 82
  • 101
Chris
  • 101
  • 1
  • 4

2 Answers2

24
manifest.json
{
  ... 
  "permissions": [
    "<all_urls>" 
  ]
}
sonichy
  • 1,370
  • 2
  • 14
  • 17
0

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

Paul Heil
  • 295
  • 1
  • 9