Search 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 replies
  • 1 has this problem
  • 2 views
  • Last reply by 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?

All Replies (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

Helpful?

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/

Helpful?

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

Helpful?

Ask a question

You must log in to your account to reply to posts. Please start a new question, if you do not have an account yet.