Closed mystiquewolf closed 2 years ago
Thank you for this note. I hope to find time to test later this week.
I've been looking at the code.
If not too late to save some research - i think in initObjects()
you'll have to use browser.tabs.query({ hidden: false });
.
Maybe an option can be added whether to reload hidden tabs and a check in reloadAll()
if the .hidden
property gives true
.
You'll also have to add browser.tabs.onUpdated.addListener(listener, {properties: ["hidden"});
to add/remove the tab from the oTabs's lists depending on the new value.
Thanks. Version 2.0 is live with this change. I only updated the quick switching behavior (the toolbar button or the keyboard shortcut). On the list, the hidden/discarded tabs still appear, but with diagonal shading in the background. At this point, they can be clicked to open; I'm not sure whether to completely hide them or whether that is enough to avoid accidentally redisplaying them.
I see that the discarded tabs now have stripes and it seems okay. For example i have the extension called "Auto Tab Discard" and it discards most of my tabs, because i've been at 300 tabs i think. Maybe not but 200. So the "Auto Tab Discard" extension does add this blue "zz" icon in front of the tabs but when you add the background the effect looks more complete. However i don't know if this feature is purely cosmetic for your extension. It's called "skip list" but i'm not sure what is skipped - when you click the tab it's activated and it stops being discarded (which is the correct behaviour).
About the hidden tabs, i'm not sure if there even has to be functionality to display them in your extension at the first place. After all - they are supposed to be hidden, they ARE hidden and by a 3rd party extension. It's supposed that the extension that hid them should be responsible for unhiding them. At least if you provide an ability to list them it should be under a pref and the default should be to hide them. That's my opinion. For example if i've got 150 tabs and i stash them - they are hidden until i unstash them. But what's your extension going to do in that case? It's going to continue showing them, but the idea is to throw them away while preserving their state to disk and potentially opening/unstashing an older stash of tabs. Your extension should then show only the tabs that are currently opened and not hidden (sorted by last accessed). For example - a "personal" stash and a "work" stash.
Some issue i found:
I don't know where the ZZZ came from. ??
The skip list is related to the button/keyboard shortcut functionality, it is not applied to the tab list.
I see your point about hiding a bunch of tabs at once but I don't have an immediate idea of how best to update the list.
Don't worry, the "ZZZ" is not some illuminati-injected code in your extension. It's from the "Auto Tab Discard" extension. 😁
So i may write some pull request if i get some time but i don't know if or when.
Hidden tabs are now omitted from the lists in version 2.0.1.
Thank you for the extension and the change, now it's even better!
Certain Firefox extensions like Tab Stash hide some of the tabs. After they are hidden they are still listed in the list of recently switched tabs.
I don't know what clicking them would do but i believe it would activate and unhide them. I don't want to test this because it might break some logic in the Tab Stash extension.
TL;DR: The tab list in switch-to-previous-active-tab should not be polluted with hidden tabs.