Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Extension suddenly broke in Firefox #229

Open
Sp00ph opened this issue Dec 30, 2022 · 22 comments
Open

Extension suddenly broke in Firefox #229

Sp00ph opened this issue Dec 30, 2022 · 22 comments

Comments

@Sp00ph
Copy link

Sp00ph commented Dec 30, 2022

I'm using Firefox 108.0.1 and the most recent version of the add-on, which is 1.9.1. The experience in Firefox with the add-on has always inferior to the experience in Chrome for me (search results sometimes not showing up properly, pressing Enter on a search result sometimes just leads you to a different page?, etc.), but generally it's been working fine. Since today it's not showing me any search results anymore though. When I type in the rs prefix, it's still showing me the rust search extension suggestion, but it doesn't seem to actually find the proper link:

image

Even actions that don't require any actual querying don't work:

image

(When I press enter on the highlighted suggestion, nothing happens)

I haven't changed any configuration/settings, and I don't think my Firefox had any updates. The search extension is also still working just fine in Chrome.

(Sidenote, but is it possible to set up the search extension as a Firefox search engine somehow, so that you can just press Tab after typing the rs prefix and then only get rust search results? It's doing that by default in Chrome for me, but not in Firefox)

@Sp00ph
Copy link
Author

Sp00ph commented Jan 1, 2023

Welp, it suddenly started working again. Would still be interested in answers for my other questions though.

@allsey87
Copy link

I have the same issue. I type in rs + space but there is no change in the search bar.

@pickx
Copy link

pickx commented Dec 19, 2023

I have the same issue. I type in rs + space but there is no change in the search bar.

for the benefit of anyone who sees this: just had the same thing happen here.
I managed to fix it on my machine by exporting data to a JSON file (from the extension settings), uninstalling/reinstalling the extension, and then re-importing the JSON.

@Diegovsky
Copy link

I have the same issue. I type in rs + space but there is no change in the search bar.

for the benefit of anyone who sees this: just had the same thing happen here. I managed to fix it on my machine by exporting data to a JSON file (from the extension settings), uninstalling/reinstalling the extension, and then re-importing the JSON.

while doing that indeed solves it, it is definetely not ideal

@DCNick3
Copy link

DCNick3 commented Jan 24, 2024

I've tried debugging this when this happened to me.

I think this is due to local storage going into an inconsistent state, where getting the 'index-std-nightly' key returns an object with all properties being undefined here and the searchIndex fallback not being used. This later causes a TypeError here.

image

Curiously, browsing the local storage in devtools shows the stored value to be just {}, but I guess it doesn't make a difference for the || operator.

image

Removing the index-std-nightly local storage entry with devtools makes the extension work again. I am not sure why this local storage key gets set to an "empty" object though =(

@Diegovsky
Copy link

Diegovsky commented Jan 31, 2024

Is there a way to clean this index-std-nightly in firefox?

@DCNick3
Copy link

DCNick3 commented Jan 31, 2024

@Diegovsky, it's pretty tedious, but this is how I did it:

  1. Go to about:addons
  2. Press Gear Icon > Debug Add-ons
  3. Find the Rust Search Extension
  4. Press Inspect button next to the extension name
  5. In the Inspector go to Storage tab
  6. Select Extension Storage in the panel on the left
  7. Find the offending key (index-std-nightly)
  8. Right click on it > Delete "index-std-nightly"
  9. Reload the extension by pressing F5 in the inspector window

It would be nice to see the root cause of this "corruption" identified though..

@Folyd
Copy link
Member

Folyd commented Feb 14, 2024

Hi all, I just released the v1.13.0 yesterday, I think this issue has been fixed in the new version. Please feel free to report if you encounter any bugs.
https://rust.extension.sh/changelog/#v1-12-0-2023-07-15

@g2p
Copy link

g2p commented Feb 23, 2024

I'm on v1.13.0, sending a search / selecting a search result had no effect, following @DCNick3's steps and clearing index-std-nightly (previously {}) fixed it.

@yannbolliger
Copy link

Same, here. It seems that the extension still regards the string "rs" as input and thus only provides matches for "docs.rs" crates because it matches on the rs.

@Folyd
Copy link
Member

Folyd commented Jun 27, 2024

I'll release Rust Search Extension v2.0 soon, this is a big version.

@Folyd
Copy link
Member

Folyd commented Oct 16, 2024

Rust Search Extension v2.0 has been released.
https://github.com/huhu/rust-search-extension/releases/tag/v2.0.0

@Folyd Folyd closed this as completed Oct 16, 2024
@yannbolliger
Copy link

yannbolliger commented Oct 16, 2024

Sadly, there still is an issue in Firefox (v131.0.3). The extension works after installing it.
Also, the issue that rs<space> doesn't work is fixed. But then, after 1-2 searches it just doesn't do anything anymore when you press enter after typing "rs ".

I can make it work again by "reloading" the addon in the debug addons page of Firefox.

@Folyd
Copy link
Member

Folyd commented Oct 16, 2024

Hi @yannbolliger, it works on my Firefox. Just confirming are you sure you upgraded to v2.0?

@Folyd
Copy link
Member

Folyd commented Oct 16, 2024

Uninstall then reinstall the latest version should fix the problem.

@yannbolliger
Copy link

It's with v2.0.0 of the addon. I reinstalled it in the browser, I restarted the browser.
At first, it worked but then, after some time, it started not doing anything when pressing enter.

As said, I can make it work again by "reloading" the addon in the debug addons page of Firefox.

@MolotovCherry
Copy link

MolotovCherry commented Oct 16, 2024

Similar experience. On Firefox latest (131.0.3, running extension version 2.0). Std docs work initially, but after restarting browser, std docs don't show in the search anymore. Turning the addon off and on again temporarily fixes it, although it comes back quickly (usually within 10 minutes for me)

I have tried going into debug settings and wiped the entire storage data of the addon. (I have also already uninstalled and reinstalled a few times as well)

>> I can also confirm that the omnibox on the search extension page continues to work normally despite the firefox search bar not working.

Before:

image

After:

image
image

@Folyd
Copy link
Member

Folyd commented Oct 17, 2024

I found the possible reason why it stops working after restarting the browser. It's because I upgraded to Manifest V3, and I guess Firefox never automatically activates V3 extensions and don't allow persistence background script according to Manifest V3 migration guide.

Firefox don't support service worker for V3 (which not a problem on Chrome): https://bugzilla.mozilla.org/show_bug.cgi?id=1573659

The quick fix is that after launching, you should click the extension icon on the toolbar to activate the extension.

@Folyd Folyd reopened this Oct 17, 2024
@Folyd Folyd pinned this issue Oct 17, 2024
@pickx
Copy link

pickx commented Oct 24, 2024

The quick fix is that after launching, you should click the extension icon on the toolbar to activate the extension.

this works for me, but after about 2 minutes of browsing, search stops working again. I haven't timed it, but this happens consistently.

@freedit-dev
Copy link

Temporary solution:

Install Version 1.13.0 from

https://addons.mozilla.org/en-US/firefox/addon/rust-search-extension/versions

And disable Allow automatic updates

image

@DCNick3
Copy link

DCNick3 commented Nov 24, 2024

Another workaround I found: you can open devtools like in this instruction here and keep it open.

Having devtools on the background script open will prevent it from going to sleep (you can see messages like "Background event page was not terminated on idle because a DevTools toolbox is attached to the extension.")

@gihrig
Copy link

gihrig commented Dec 11, 2024

2 years later the problem remains. Is Firefox just not fully supported any more?

Firefox 133.0.3
RS Search Ext 2.0.0
MacOS 15.1.1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests