Firefox WebExtensions and Cross-domain privileges
Asked Answered
I

2

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.

Implosive answered 14/4, 2016 at 17:8 Comment(0)
S
24
manifest.json
{
  ... 
  "permissions": [
    "<all_urls>" 
  ]
}
Sherfield answered 5/8, 2016 at 3:5 Comment(0)
B
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.

Bracteole answered 27/5, 2016 at 13:29 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.