evilpie / add-custom-search-engine

Add a custom search engine to the list of available search engines in Firefox
https://addons.mozilla.org/en-US/firefox/addon/add-custom-search-engine/
Mozilla Public License 2.0
173 stars 13 forks source link

Getting NetworkError when attempting to add search engine #59

Closed Vasiimr closed 9 months ago

Vasiimr commented 9 months ago

I'm getting an error adding search engines, the screenshot is attached. Regardless of what website or options I check, I always get this error upon clicking 'Add custom search engine':

TypeError: NetworkError when attempting to fetch resource.

image

Firefox 119.0.1, Windows 10

onjour commented 9 months ago

Same, a hint on how to fix this would be greatly appreciated!

Firefox 119.0.1 running on Apple M1 Pro 14.0

jrcastine commented 9 months ago

paste.mozilla.org forwards to https://prod.pastebin.prod.webservices.mozgcp.net. Could this be a change that's causing the issue?

onjour commented 9 months ago

paste.mozilla.org forwards to https://prod.pastebin.prod.webservices.mozgcp.net. Could this be a change that's causing the issue?

You're right, I modified the extension and replaced every occurrence of this by the redirect and tried it on Nightly as a temporary addon and it worked. I'm no developer but that's the way to go I think, tried to do a PR. Thank you for the hint

Vasiimr commented 9 months ago

I think that's the case, I opened up console to take a look at the requests being sent out after clicking the add custom search engine button and I see a few errors, one of which is talking about 'The Same Origin Policy disallows reading the remote resource at https://prod.pastebin.prod.webservices.mozgcp.net/api/. (Reason: CORS header ‘Access-Control-Allow-Origin’ missing). Status code: 405.'

image

evilpie commented 9 months ago

Thanks for the report. The redirect is probably temporary so updating the extension is probably a waste of time.

Otherwise I would be open to alternative suggestions for hosting that are trustworthy.

v-v-vishnevskiy commented 9 months ago

Temporary fix

  1. Clone this repo.
  2. Replace https://paste.mozilla.org/api/ on https://prod.pastebin.prod.webservices.mozgcp.net/api/ in search.js file
  3. In Firefox open about:debugging
  4. Click the This Firefox option
  5. Click the Load Temporary Add-on button
  6. Choose the manifest.json file.
Vasiimr commented 9 months ago

Temporary fix

1. Clone this repo.

2. Replace `https://paste.mozilla.org/api/` on `https://prod.pastebin.prod.webservices.mozgcp.net/api/` in search.js file

3. In Firefox open `about:debugging`

4. Click the `This Firefox` option

5. Click the `Load Temporary Add-on` button

6. Choose the `manifest.json` file.

I believe in addition you also need to replace line 38 in the manifest.json to be https://prod.pastebin.prod.webservices.mozgcp.net/api/ rather than https://paste.mozilla.org/api/ for this temporary fix to work

v-v-vishnevskiy commented 9 months ago

@Vasiimr Yeah, forgot about this. Thank you!

onjour commented 9 months ago

Thanks for the report. The redirect is probably temporary so updating the extension is probably a waste of time.

How do we know if this is a temporary redirect? If it stays like this everyone who'd like to use this extension won't be able to in the meantime. Your call but it's wasting their time too

evilpie commented 9 months ago

https://paste.mozilla.org/ is operating normally again.