Søg i Support

Avoid support scams. We will never ask you to call or text a phone number or share personal information. Please report suspicious activity using the “Report Abuse” option.

Learn More

Accessing resources from localhost through a web extension for testing

  • 3 svar
  • 1 har dette problem
  • 7 visninger
  • Seneste svar af nnhien

more options

I've been trying to access some resources hosted locally with a web extension for testing, but I've been encountering CORS errors. I've added localhost to the permissions field of the extension's manifest.json, but I still encounter the CORS errors. I saw that bugs 1220810 and 1488740 addressed similar bugs in FF84, but Firefox still won't let me send the requests. If it helps at all, I've been trying to access the resources hosted on localhost from an https context, but I was under the impression that those bugs should have fixed that issue?

Ideally I wouldn't need to implement having the server respond with the CORS headers since it only seems to be a problem with Firefox in a local context. Accessing the local resources through Chrome works, and accessing the resources through the internet with the domain name in the permissions field of a production build of the extension's manifest.json works in Firefox. Is there a way to make Firefox disregard CORS enforcement for localhost for temporary extensions?

I've been trying to access some resources hosted locally with a web extension for testing, but I've been encountering CORS errors. I've added localhost to the permissions field of the extension's manifest.json, but I still encounter the CORS errors. I saw that bugs [https://bugzilla.mozilla.org/show_bug.cgi?id=1220810 1220810] and [https://bugzilla.mozilla.org/show_bug.cgi?id=1488740 1488740] addressed similar bugs in FF84, but Firefox still won't let me send the requests. If it helps at all, I've been trying to access the resources hosted on localhost from an https context, but I was under the impression that those bugs should have fixed that issue? Ideally I wouldn't need to implement having the server respond with the CORS headers since it only seems to be a problem with Firefox in a local context. Accessing the local resources through Chrome works, and accessing the resources through the internet with the domain name in the permissions field of a production build of the extension's manifest.json works in Firefox. Is there a way to make Firefox disregard CORS enforcement for localhost for temporary extensions?

Alle svar (3)

more options

Just in case you don't find a solution here, there's a forum for extension development support over on:

https://discourse.mozilla.org/c/add-ons/development

more options

I don't know whether the following extension -- a kind of global workaround for CORS issues -- sees requests from extension pages:

https://addons.mozilla.org/firefox/addon/cors-everywhere/

more options

jscher2000 said

Just in case you don't find a solution here, there's a forum for extension development support over on: https://discourse.mozilla.org/c/add-ons/development

Ah my bad, I'll try there if I don't get a response here.

jscher2000 said

I don't know whether the following extension -- a kind of global workaround for CORS issues -- sees requests from extension pages: https://addons.mozilla.org/firefox/addon/cors-everywhere/

I've tried CORS Everywhere and unfortunately it doesn't seem like it can access requests from other extensions