rNeomy / auto-tab-discard

Use native tab discarding method to automatically reduce memory usage of inactive tabs

Home Page:https://webextension.org/listing/tab-discard.html

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

(at least) "Discard Other Tabs in This Window" doesn't work, error logged

jmbreuer opened this issue · comments

I've noticed that "Discard Other Tabs in This Window" doesn't seem to do anything any more (I'm quite sure it did work at some point in time for me). This is according to about:performance, and also none of the tabs' appearance changing (no sleep icon, etc).

When I click on "Discard Other Tabs" within "Discard Tabs in This Window", (with Logging on in Options - but probably doesn't matter, I don't see other logging from AutoTabDiscard around the error), there's an error shown in the Browser Console that seems pertinent:

Uncaught (in promise) Error: Type error for parameter queryInfo (Unexpected property "autoDiscardable") for tabs.query.
    apply moz-extension://a68f8d48-1d56-4504-9192-fa422b73cdc3/v2/chrome.tabs.query.js:4
    query moz-extension://a68f8d48-1d56-4504-9192-fa422b73cdc3/worker/core/utils.mjs:12
    query moz-extension://a68f8d48-1d56-4504-9192-fa422b73cdc3/worker/core/utils.mjs:12
    check moz-extension://a68f8d48-1d56-4504-9192-fa422b73cdc3/worker/modes/number.mjs:100
chrome.tabs.query.js:4:22

It seems that execution stops at this point, i.e. no (more) tabs are discarded.

Initially, I had a hunch that this might have to do with not-yet-loaded background tabs (i.e. those created from a middle click on a link as I have configured it ("Open in background tab"), that come up with a blue italic label, but no sleep icon, and only properly load once I activate them) - but I just created a test window with a small handful of only fully loaded tabs, and "Discard Tabs in This Window" -> "Discard Other Tabs" also fails immediately, with the above error message.

Discarding Tabs individually (i.e. just "Discard Tab") works as expected, Tab disappears from (its high-usage place in) about:performance and gets a sleep icon / blue italic tab label.

AutoTabDiscard Version: 0.6.7
Browser: LibreWolf 114.0.2-1
Additional Extension: Tree Style Tab 3.9.15
OS: gentoo Linux 6.1.31-gentoo SMP PREEMPT_DYNAMIC x86_64

Reading up on AutoTabDiscard some more, I found that I can also click on "Discard Other Tabs in This Window" from the extension (button) overlay, rather than (only) in the context menu (as I'd always accessed this before).

Using the overlay has the additional feature of holding down the shift key while clicking on the function, which causes ATD to disregard per-Tab "do not discard" settings. Using it like this, the "Discard Other Tabs in This Window" function works for me, and is an acceptable workaround for me, for now. (Holding down shift while using the context menu entry does not change anything for me.)

I guess this is because in that Shift+Click mode, that querying of all the tabs for their discard-relevant properties - which is where the error above seems to point at - simply does not happen at all.

I have the same problem with all the actions that should disable several tabs at once

Same issue here in Opera. I tried both operas and chromes latest versions.
The workaround is working.

Unrelated, the extension "Tab Discard (Suspender)" is able to discard a tab whilst you're still on the tab without having to open another tab to stop it from reloading. Something you can look into if you'd like :)

Thanks a bunch for the well featured extension!

Hayden.