vimium icon indicating copy to clipboard operation
vimium copied to clipboard

Did switching tabs via ‘T’ pretty much stop working in Firefox with the update to FF 115 or so?

Open decadent opened this issue 2 years ago • 9 comments

I'm on Firefox Developer Edition, having recently updated it to 115.0b6. It seems that shift-t doesn't produce any results anymore—granted, I have the habit of opening hundreds of tabs, but that shouldn't really be a problem for the code. Seeing as Vimium-FF was last updated about half a year ago, seems that something in FF affected this behavior.

For now, just wanted to know if I'm the only one experiencing this, or it's indeed an issue for other users too.

To Reproduce

  1. Open some tabs, might need 400 of them or so.
  2. Press T on a page and type something that does occur in tab titles or addresses.
  3. Observe nothing appearing in the results.

Browser and Vimium version

Firefox: 115.0b6, build ID 20230615175802, on MacOS 10.14. Vimium: 1.67.6, last updated January 10, 2023.

decadent avatar Jun 23 '23 11:06 decadent

Not reproduced on a fresh Firefox 115.0b9 x64, Vimium 1.67.6 and Win11:

  1. I opened a tab of file:///R:/ and duplicate it by 400 times
  2. pressed Shift+T and typed file
  3. Vomnibar did show matches as expected

The test also passed wiht 400 http://localhost tabs.

gdh1995 avatar Jun 24 '23 16:06 gdh1995

I can confirm for ff 114.0 vimium 1.67.6 debian unstable more than 1k tabs

legion151 avatar Jul 03 '23 15:07 legion151

@legion151 You mean confirm that it works?

Actually, it started working again for me, so idk what caused the problem. Haven't updated FF or anything. So I was thinking of closing the issue.

decadent avatar Jul 03 '23 16:07 decadent

Sry - meant to confirm the issue. I updated last week after a long while, and after that it was broken. It is still broken for me. But if yours fixed itself i might also be lucky....

legion151 avatar Jul 03 '23 16:07 legion151

Minor update. Fresh (or mostly unused) profile of firefox works. In my default profile the problem exists even for firefox 115.0

legion151 avatar Jul 10 '23 23:07 legion151

There is following exception shown in console. However I am not sure if related.

Uncaught TypeError: this.completions[this.selection] is undefined
    onInput moz-extension://d23c1414-47cf-4260-8322-c5062c7d77dd/pages/vomnibar.js:292
    initDom moz-extension://d23c1414-47cf-4260-8322-c5062c7d77dd/pages/vomnibar.js:340
    VomnibarUI moz-extension://d23c1414-47cf-4260-8322-c5062c7d77dd/pages/vomnibar.js:59
    activate moz-extension://d23c1414-47cf-4260-8322-c5062c7d77dd/pages/vomnibar.js:30
    <anonymous> moz-extension://d23c1414-47cf-4260-8322-c5062c7d77dd/pages/vomnibar.js:448
    onmessage moz-extension://d23c1414-47cf-4260-8322-c5062c7d77dd/pages/ui_component_server.js:23
    portOpen moz-extension://d23c1414-47cf-4260-8322-c5062c7d77dd/pages/ui_component_server.js:21
    registerPort moz-extension://d23c1414-47cf-4260-8322-c5062c7d77dd/pages/ui_component_server.js:9

legion151 avatar Jul 10 '23 23:07 legion151

Another update. This issue now also appeared on my second device. There were no updates n stuff.

Also i noticed that, bindings like "g SEARCH" doesn't open google but the default search engine anymore.

legion151 avatar Jul 12 '23 22:07 legion151

I've run into the same issue today when using the vomnibar (FF 115.4.0esr), with one of the following error messages (depending on query input):

Error messages
Uncaught (in promise) TypeError: string is undefined
    escapeHtml moz-extension://<uuid>/lib/utils.js:74
    generateHtml moz-extension://<uuid>/background_scripts/completion.js:95
    postProcessSuggestions moz-extension://<uuid>/background_scripts/completion.js:678
    filter moz-extension://<uuid>/background_scripts/completion.js:645
    filterCompletions moz-extension://<uuid>/background_scripts/main.js:623
    <anonymous> moz-extension://<uuid>/background_scripts/main.js:667
    addChromeRuntimeOnMessageListener moz-extension://<uuid>/lib/utils.js:378
    addChromeRuntimeOnMessageListener moz-extension://<uuid>/lib/utils.js:380
utils.js:74:5
Uncaught (in promise) TypeError: thing is undefined
    matches moz-extension://<uuid>/background_scripts/completion.js:696
    results moz-extension://<uuid>/background_scripts/completion.js:484
    filter moz-extension://<uuid>/background_scripts/completion.js:484
    promises moz-extension://<uuid>/background_scripts/completion.js:643
    filter moz-extension://<uuid>/background_scripts/completion.js:643
    filterCompletions moz-extension://<uuid>/background_scripts/main.js:623
    <anonymous> moz-extension://<uuid>/background_scripts/main.js:667
    addChromeRuntimeOnMessageListener moz-extension://<uuid>/lib/utils.js:378
    addChromeRuntimeOnMessageListener moz-extension://<uuid>/lib/utils.js:380
completion.js:696:11

Assuming that there's some pathological tab/tabs (and having too many tabs open to go through manually), I've iteratively modified sessionstore.jsonlz4 via MozLz4a and bisected the tab entries by removing all tabs except for some subset and checking whether the issue persists. This allowed to narrow down the problem to a tab with empty entries attribute:

{"entries":[],"lastAccessed":<redacted>,"hidden":false,"searchMode":null,"userContextId":<redacted>,"attributes":{},"extData":<redacted>,"index":1,"userTypedValue":"https://ec.europa.eu/health/sites/default/files/ehealth/docs/covid-certificate_json_specification_en.pdf","userTypedClear":0,"image":null}

Manually filling in some url attribute as per

{"entries":[{"url":"about:blank"}],"lastAccessed":<redacted>,"hidden":false,"searchMode":null,"userContextId":<redacted>,"attributes":{},"extData":<redacted>,"index":1,"userTypedValue":"https://ec.europa.eu/health/sites/default/files/ehealth/docs/covid-certificate_json_specification_en.pdf","userTypedClear":0,"image":null}

did indeed solve the problem, with the vomnibar working again just fine.

So I guess the solution would be to have vimium check whether there are any tabs with empty entries attribute and if yes, assigning a dummy url attribute, analogous to the already existing checks for empty title in completion.js (though since I'm not familiar with the codebase, won't take a stab at implementing this myself).

I haven't tried to reproduce the issue, but given that the pathological tab was pointing to a PDF file (see userTypedValue attribute above) it seems likely to be connected to this.

Regarding short-term workarounds until this is fixed in vimium, I see three possibilities:

  1. Manually go through all tabs; in my case, I've tested that simply clicking the problematic tab in Firefox was enough to solve the issue (causing its url attribute to be set to about:blank). Especially look for tabs with neither favicon nor title in the tab bar. It might also work to reload all tabs at once, though in my case Firefox didn't like that and crashed (potentially too many tabs open...).

  2. Locally patching vimium with some ugly workaround; in my case, the following was sufficient to get vomnibar working again (the remaining string is undefined error in escapeHtml seemed less problematic):

    diff --git a/background_scripts/completion.js b/background_scripts/completion.js
    index 1dce5082..074d8e29 100644
    --- a/background_scripts/completion.js
    +++ b/background_scripts/completion.js
    @@ -692,7 +692,7 @@ const RankingUtils = {
           const regexp = RegexpCache.get(term);
           let matchedTerm = false;
           for (const thing of things) {
    -        if (!matchedTerm) {
    +        if (!matchedTerm && thing !== undefined) {
               matchedTerm = thing.match(regexp);
             }
           }
    
  3. Manually checking sessionstore.jsonlz4 for pathological tabs and correcting them, e.g. as per below:

    $ cp ~/.mozilla/firefox/<profile>/sessionstore.jsonlz4 sessionstore_PROD_BEFORE.jsonlz4
    $ ./MozLz4a.py -d sessionstore_PROD_BEFORE.jsonlz4 unpacked_PROD_BEFORE.json
    $ sed "s/{/{\n/g" unpacked_PROD_BEFORE.json > unpacked_PROD_BEFORE_WITH_NEWLINE.json
    $ vim unpacked_PROD_BEFORE_WITH_NEWLINE.json
    $ tr -d '\n' < unpacked_PROD_BEFORE_WITH_NEWLINE.json > unpacked_PROD_AFTER.json
    $ ./MozLz4a.py unpacked_PROD_AFTER.json sessionstore_PROD_AFTER.jsonlz4
    $ cp sessionstore_PROD_AFTER.jsonlz4 ~/.mozilla/firefox/<profile>/sessionstore.jsonlz4
    

jan-krieg avatar Nov 18 '23 22:11 jan-krieg

I've got the same issue on FF123.0.1 and vimium 2.0.6 Uncaught (in promise) TypeError: string is undefined with this tab blocking the search

​active: false
​attention: false
​audible: false
​autoDiscardable: true
​cookieStoreId: "firefox-default"
​discarded: true
​favIconUrl: "chrome://branding/content/icon32.png"
​height: 0
​hidden: false
​highlighted: false
​id: 37
​incognito: false
​index: 33
​isArticle: undefined
​isInReaderMode: false
​lastAccessed: 1709664648931
​openerTabId: 36
​pinned: false
​status: "complete"
​successorTabId: -1
​url: "about:blank"
​width: 0
​windowId: 1

nikolapintaric avatar Mar 06 '24 08:03 nikolapintaric