rNeomy / auto-tab-discard

Use native tab discarding method to automatically reduce memory usage of inactive tabs
https://webextension.org/listing/tab-discard.html
Mozilla Public License 2.0
920 stars 79 forks source link

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

Open jmbreuer opened 1 year ago

jmbreuer commented 1 year ago

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

jmbreuer commented 1 year ago

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.

challet commented 11 months ago

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

Valla56 commented 9 months ago

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.

Pictor13 commented 7 months ago

Also for me (Firefox 120.0 - 64-bit) most function-buttons don't work:

"Discard Tab" works, but only on the displayed tab or on the tab from which the context-menu was created

"Discard Tab Group" does work partially, as it behaves more similarly to a "Discard Multiple Tabs":

"Discard Tabs in This window" does not work

"Discard Tabs in Other windows" does not work

Also "Discard All Other Tabs" does not work

I'm not sure where should I check logs for reading potential errors.
Dunno how but ideally I could restore an old version of Auto Tab Discard: in the past most of the functions used to be working fine.