rust-search-extension icon indicating copy to clipboard operation
rust-search-extension copied to clipboard

Searching with rs prefix doesn't work anymore in current Firefox

Open djc opened this issue 2 years ago • 10 comments

I'm using release Firefox on macOS, and I've been using the search extension for a long time. Since a few weeks, searching using the rs prefix for the std docs no longer seems to work. If I type rs in the address bar, the options shown show the extension at the top, but there are no suggested completions and if I hit enter on something like rs Mutex nothing happens.

djc avatar Aug 04 '22 11:08 djc

Hi @djc. Thanks for the feedback. It works on my Firefox (v103, macOS). Did you try relaunch the browser? See also https://github.com/huhu/rust-search-extension/issues/156#issuecomment-1135940941

Folyd avatar Aug 04 '22 14:08 Folyd

I tried restarting the browser, and also tried removing the extension and re-installing it. After doing so, it still fails the same way.

djc avatar Aug 04 '22 14:08 djc

Could you debug the extension and send me the console log? image

Folyd avatar Aug 04 '22 14:08 Folyd

I get this too on Windows. The log says this:

23:32:54.265 Uncaught (in promise) TypeError: indexItem is undefined
    buildIndex moz-extension://9e1e7d46-fc1e-4010-ac64-5afe0cb4ddba/search/docs/base.js:86
    DocSearch moz-extension://9e1e7d46-fc1e-4010-ac64-5afe0cb4ddba/search/docs/base.js:49
    <anonymous> moz-extension://9e1e7d46-fc1e-4010-ac64-5afe0cb4ddba/main.js:79
    async* moz-extension://9e1e7d46-fc1e-4010-ac64-5afe0cb4ddba/main.js:578
base.js:86:17
    <anonymous> moz-extension://9e1e7d46-fc1e-4010-ac64-5afe0cb4ddba/main.js:577
    InterpretGeneratorResume self-hosted:1819
    AsyncFunctionNext self-hosted:807
    (Async: async)
    <anonymous> moz-extension://9e1e7d46-fc1e-4010-ac64-5afe0cb4ddba/main.js:578

This happens on load, after printing Already migrated. (seems unrelated). Reloading the extension does the same thing.

Firefox 106.0.2 (64-bit) Rust Search Extension 1.8.1

drewtato avatar Oct 28 '22 06:10 drewtato

Thanks, @drewtato. That's weird. I guess uninstalling and then re-install it can fix it.

Folyd avatar Oct 28 '22 07:10 Folyd

Thanks, @drewtato. That's weird. I guess uninstalling and then re-install it can fix it.

I also had this issue and fixed it by doing this. Before I fixed it, it also intermittently made every single other Firefox extension stop working until browser restart.

monax3 avatar Oct 28 '22 07:10 monax3

This is still a problem. I've had to reinstall the extension twice in the last week after it just randomly stopped working. I am using Firefox 121.0 on Fedora 38 with KDE Plasma.

k9withabone avatar Dec 26 '23 12:12 k9withabone

Also had this today, I played around in the developer tools. Here is what I found:

  • The value for index-std-nightly in the extension store was { std: undefined, test: undefined, proc_macro: undefined } which causes the above error.
  • The "Storage" tab of the developer tools show the value of index-std-nightly to be {} which is very weird, they should match. Confirmed this inconsistency with chrome.storage.local.get.
  • Manually setting the value, either by going to https://doc.rust-lang.org/nightly/std/index.html or with await storage.setItem("index-std-nightly", undefined) did resolve the issue after a couple of times.
  • For some reason the event listener for storage changes is only fired occasionally (registered in main.js).

The different values and the inconsistent event handling indicate this to be a Firefox bug maybe? I remember killing Firefox right before this issue appeared. Maybe the extension storage got corrupted? On the other hand this is Sqlite we are talking about.

What helped for me

  • uninstall extension
  • restart browser
  • install extension again

I now verified storage events and the value shown in the "Storage" tab of the developer tools to be working as expected again.

Funnily I ran into #265 before and after the reinstall, but before the re-install the index was still sent (weird?), after the re-install no index is sent anymore. The error seems to be caused by core/storage.js being injected multiple times as a content script according to manifest.json, search for "doc.rust-lang.org" and you will find overlapping matching expressions. But I don't think this is related.

jannschu avatar Jan 10 '24 20:01 jannschu

This happens to me on the latest Chrome 121.0.6167.161. Uninstall and reinstall works for about 1 day, then it happens again. The only thing that shows up is the crate search, but std docs is completely missing. It seems quite prevalent as I've spoken with many others who've had to stop using the extension since it doesn't reliably work anymore

Edit: Thank you for replying and taking care of this! It is indeed working now in Chrome! <3

MolotovCherry avatar Feb 13 '24 03:02 MolotovCherry

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. rust.extension.sh/changelog/#v1-12-0-2023-07-15

Folyd avatar Feb 14 '24 19:02 Folyd