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
888 stars 76 forks source link

V. 0.6.2 Broke a lot of things #307

Closed HDark15 closed 1 year ago

HDark15 commented 1 year ago

Firefox 104.0.2 Only what I usually use Discard inactive tabs after x time doesn't work From toolbar and all context menu

homlett commented 1 year ago

I confirm the issues mentioned above. Also, existing discarded tabs are lost after FF restart:

File not found.
Firefox can’t find the file at moz-extension://...
rNeomy commented 1 year ago

Let's debug:

Open "about:debugging#/runtime/this-firefox" in a browser tab and press the "Inspect" button for this extension. Do you see any errors? If not run chrome.runtime.reload() to restart the extension.

rNeomy commented 1 year ago

existing discarded tabs are lost after FF

@homlett, This extension does not use locale pages to discard tabs. It uses the native method. Even if you remove the extension, you still have your discarded tabs. The page that you are referring must be a local page of another extension.

imcraymond commented 1 year ago

I'm on the FF beta channel and have the same issue. I see no errors in the about:debugging panel. I noticed yesterday the tab right-click menu item was missing. It did exist after restarting FF this morning, but I "think" running the reload command above got rid of it again. A subsequent restart brought it back. Disable/enable extension does not bring it back. It simply appears that the timer is not running in my limited experience, though I don't use the other features mentioned above.

HDark15 commented 1 year ago

I only got this Reading manifest: Warning processing storage: An unexpected property was found in the WebExtension manifest.

rNeomy commented 1 year ago

What the output of the following in the inspect -> console tab:

chrome.alarms.getAll(a => console.log(a))

Can you guys reproduce the issue on a clean profile? https://support.mozilla.org/en-US/kb/profile-manager-create-remove-switch-firefox-profiles

anpryl commented 1 year ago

Evaluating chrome.alarms.getAll(a => console.log(a)) Result:

Uncaught TypeError: chrome.alarms is undefined
    <anonymous> debugger eval code:1
anpryl commented 1 year ago

It looks like chrome.runtime.reload() fixed issues for me.

imcraymond commented 1 year ago

At home I'm using 104.0.2 and see the same issue. I also see the manifest warning mentioned above, and the reload() removes the tab right click menu item. Makes me suspect a possible extension interference. Below is a copy/paste of above command. chrome.alarms.getAll(a => console.log(a)) undefined Array [] The array is rather expansive, poking around I didn't see anything that stood out to me.

rNeomy commented 1 year ago

It seems like the extension is not initiated correctly in the reports. Wait for the 0.6.3.1 release to pass the review and report back. Hopefully, the issue is fixed.

Sada-Mio commented 1 year ago

Can you guys reproduce the issue on a clean profile? https://support.mozilla.org/en-US/kb/profile-manager-create-remove-switch-firefox-profiles

Able to reproduce with clean Firefox profile

Reverting back to older 0.5.0 and disable auto-update for the extension is workaround while awaiting fix.

EvPw commented 1 year ago

It still doesn't seem to be working for me after the latest update. Extension still won't discard my tabs after a set time frame. I'll try different settings and will update if I get a different result

imcraymond commented 1 year ago

FYI, with 0.6.3.1, things are mostly the same as above (e.g. manifest issue, etc.). On a good note doing the reload() does NOT remove the mouse right click menu option. Hopefully that is a clue.

imcraymond commented 1 year ago

Also just noticed, if I'm on one tab and right mouse click and select "Discard Tab" on another tab, it appears to have been discarded (e.g. shows the icon). But when I return to that tab it is at it's previous state, it used to reload the page. Hope I explained that correctly. This is with regards to old.reddit.com...

EvPw commented 1 year ago

Update: Conducted further tests on ATD within Firefox hours ago, and it still doesn't automatically discard inactive tabs after a set time period. also noticed this upon inspection of the extension: Screenshot 2022-09-12 113621

rNeomy commented 1 year ago

Unfortunately, I cannot reproduce the issue.

https://user-images.githubusercontent.com/14104614/189809237-8a263742-53fb-4c07-ab3f-90e1c301c250.mp4

rNeomy commented 1 year ago

Update: Conducted further tests on ATD within Firefox hours ago

How about?

Discard inactive tabs after 1 minute when the number of inactive tabs exceeds 0

Sada-Mio commented 1 year ago

Unfortunately, I cannot reproduce the issue.

Seems to depend on which website is loaded.

Fresh profile, version 0.6.3.1, uBlock (settings > default behavior > disable JavaScript), amazon.com is able to discard, but etsy.com can't discard. Something breaks.

Change uBlock javascript back to enable, etsy.com is now able to discard without issue.

https://user-images.githubusercontent.com/38301959/189888560-891899e6-8075-4028-8b05-e6e27dcd380b.mp4

rNeomy commented 1 year ago

@Sada-Mio any errors on the browser console (Ctrl + Shift + J)? How about about:debugging#/runtime/this-firefox -> Inspect -> Console?

imcraymond commented 1 year ago

I see a lot of the following, doesn't matter which tab I'm on: TypeError: channel.loadInfo.loadingPrincipal is null matchRequest resource://devtools/server/actors/network-monitor/utils/network-utils.js:392 _shouldIgnoreChannel resource://devtools/server/actors/network-monitor/network-observer.js:258 _onRequestHeader resource://devtools/server/actors/network-monitor/network-observer.js:775 observeActivity resource://devtools/server/actors/network-monitor/network-observer.js:660 makeInfallible resource://devtools/shared/ThreadSafeDevToolsUtils.js:103

Also, reloading the Toolbox tab for this extension returns: Content Security Policy: The page’s settings blocked the loading of a resource at inline (“default-src”). 2 chrome:508:24 Content Security Policy: The page’s settings blocked the loading of a resource at inline (“default-src”). chrome:62:22

Wilkolicious commented 1 year ago

Still not working for me on Firefox. Reverted back to 0.5.0 and everything working again.

Sada-Mio commented 1 year ago

@Sada-Mio any errors on the browser console (Ctrl + Shift + J)? How about about:debugging#/runtime/this-firefox -> Inspect -> Console?

browser console (Ctrl + Shift + J) Annotation 2022-09-13 131332

about:debugging#/runtime/this-firefox -> Inspect -> Console

There was nothing there for several of the clean profiles used to test, but one of them had console content. Not sure why.

Annotation 2022-09-13 142353

Don't know if this matters, but when updating auto-tab-discard extension from 0.5.0 to the 0.6.3.1 I get this error

Annotation 2022-09-13 144022

imcraymond commented 1 year ago

I just noticed something curious. I had set it to "Discard inactive tabs after 1 minutes (zero to disable) when the number of inactive tabs exceeds 0" as mentioned previously. I always load a few Reddit pages early in the morning, today some servers were whacked and I didn't go to Reddit for a while.

It appeared that tabs were being discarded correctly, until I went to a Reddit page.

Below are the extensions I use for Reddit: Old Reddit Redirect Reddit (Au) Comment Highlights Reddit Enhancement Suite

I still don't see anything in the Toolbox tab for Auto Tab Discard, but today the manifest warning I've always seen in the Debugging tab is gone. Neither Firefox or the add-on upgraded. There were a few other extensions that also showed that warning, they have also cleared up.

imcraymond commented 1 year ago

So I disabled the above add-ons, restarted Firefox and repeated with the same result. Not sure why old.reddit would cause issues, but I hope this helps.

imcraymond commented 1 year ago

Did some more experimentation. I use uBlock Origin with all the filters, after disabling uBlock Origin on old.reddit, things appear to be hibernating (though it does take a lot longer than 1 minute).

Sada-Mio commented 1 year ago

Unfortunately, I cannot reproduce the issue.

@rNeomy did further testing on a clean profile with the top 100 US websites to see which sites are unable to discard with uBlock javascript disabled

Found the following could not:

Noticed a common pattern. Any website loaded with googletagmanager.com blocked would break discard via "discard all other tabs". Further more, also prevents other tabs from discarding. Discard function will work again closing the problematic tab as if it got stuck.

Annotation 2022-09-14 161210

https://user-images.githubusercontent.com/38301959/190280577-6abdae73-4b95-4d18-a732-e7a39c5a43de.mp4

LeetHaxor commented 1 year ago

Still not working on firefox. Have to use 0.5.0 to get it to work properly.

re11ding commented 1 year ago

I'm also having issues. Simply having ublock origin enabled seems to cause functionality to break for me. You can disable the addon or disable it on that tab and it'll cause functionality to return on a cache refresh. This is specifically for Firefox. Does not matter if ublock is blocking javascript or not. There are several websites the functionality isn't working with.

re11ding commented 1 year ago

Still not working on firefox. Have to use 0.5.0 to get it to work properly.

How are you downgrading? I'd like to as well to fix things for the time being.

HDark15 commented 1 year ago

@re11ding Go to the Firefox extension page, scroll down to the "More information", there's Version History click "See all versions", click download file on the version you want

EvPw commented 1 year ago

Update #2: The latest version of ATD now is working for me on Firefox

rNeomy commented 1 year ago

I think I found the issue. Can you guys give the developer version a try and let me know if it works for you or not?

  1. Download https://github.com/rNeomy/auto-tab-discard/archive/refs/heads/master.zip
  2. Extract to a local directory
  3. Open "about:debugging#/runtime/this-firefox" in a browser tab
  4. Use the "Load Temporary Add-on" button and point it to "v3 -> manifest.json"
Ved-un commented 1 year ago

Downloaded and again this

flameshot_262

But it seems to work and unloads the tabs...

imcraymond commented 1 year ago

Appears to be working for me also, though I wish I disabled the original one first. Confused me for a bit.

I've noticed several add-ons with that manifest warning, so I suspect that is due to seeing a manifest v3 attribute and not worth looking at.

Sada-Mio commented 1 year ago

update appears to be working. Previously site like etsy.com or nytimes.com would not discard, but now it does.

EvPw commented 1 year ago

I suspect it was due to the manifest warning

HDark15 commented 1 year ago

The developer version appears to be working on my end

rNeomy commented 1 year ago

Perfect! The new release (0.6.3.2) now includes the fix.

HDark15 commented 1 year ago

Sorry just another thing, "Open in new discarded tab" when you click the tab it will not automatically reload and need to be refreshed. But it's not a big deal, thank you.

rNeomy commented 1 year ago

"Open in new discarded tab" when you click the tab it will not automatically reload

Will be fixed by the next release. Thanks for the report.

imcraymond commented 1 year ago

@rNeomy Thank you for working/fixing this. Sincerely appreciated.