Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Doesn't display tabs suspended by "The Great Suspender" #1

Open
karanrajpal14 opened this issue Apr 6, 2018 · 8 comments
Open

Doesn't display tabs suspended by "The Great Suspender" #1

karanrajpal14 opened this issue Apr 6, 2018 · 8 comments

Comments

@karanrajpal14
Copy link

I use this extension to suspend my tabs after a certain timeout. Unfortunately, Tabulator doesn't display these tabs. Is there any way you can get around this?

@akhaku
Copy link
Owner

akhaku commented Apr 10, 2018

Sorry, haven't really had time to look into this. If they're actually "removing" the tabs there isn't much I can do - right now I'm just fetching the tabs using chrome's main query tabs API.

@karanrajpal14
Copy link
Author

No worries. Have a look whenever you've got the time. Just wanted to bring this up as I rely on TGS heavily.

@mikhoul
Copy link

mikhoul commented Jun 10, 2018

@karanrajpal14 @akhaku

I use also The Great Discarder and the same thing happen but ti's normal since tabs are suspended the extension don't have access to the tab to screenshot them.

Unless there is a way with https://developer.chrome.com/extensions/tabs#method-discard to load discarded tabs and unload/discard them after they have their screenshot it would be the only way to make that.

But I have not enough knowledge to know if it is technically feasible to do that ? Maybe @akhaku will know better than me on this issue.

Regards :octocat:

The onl;y strategy

@mikhoul
Copy link

mikhoul commented Jun 13, 2018

@akhaku I was making some test for myself with new CSS that suit more my needs (usually over 100 tabs by windows) and I found a small issue.

When the one tabs goes in discarded state it remove the "screenshot" from the tile so it's not very useful to manage my big tab groups since most of the tabs goes to sleep after 2-3 hours if I don't use them.

So when I look at the "dashboard" most of the tabs are without screenshot.

Moreover soon Chrome by default will suspend automatically tabs by default if you are low on memory or don't use them for long time so the same problem will happen for everybody.

A workaround to resolve this issue could be to don't delete or acknowledge the screenshot has changed until that a tab would be closed or the the tabs changed URL.

For my big tabs groups my strategy to see al the screenshot and mange them easily was to wake up once all >150 tabs and let Tabulator take a screenshot and after it's done I discard all my tabs to save memory... it work fine till I discard my tabs, as soon a tabs is discarded the screenshot is deleted.

Do you think you will be able to resolve this issue, if not I can search for a more precise strategy by reading the documentation of the API to see what could work especially since discarding tabs on low memory will be soon implemented in Chrome automatically ? 🤔

Here's the flag that will be enabled soon by default in Chrome to discard automatically unused tabs:
image

Regards :octocat:

@akhaku
Copy link
Owner

akhaku commented Jun 13, 2018

The extension drops the screenshot when the tab is closed - it's possible that chrome makes it look like the tab is closed when it is "discarded". I don't think it's a good idea to not discard screenshots when a tab is closed, since then we'll be retaining screenshots indefinitely. If there's a way to differentiate between discarded and closed then great, that's probably doable (although what if you discard a tab and then close it - does the close event occur?)

@mikhoul
Copy link

mikhoul commented Jun 13, 2018

"it's possible that chrome makes it look like the tab is closed when it is "discarded".

Yes after studying more I think it's the real problem, the "discard" function/API was done after "onRemove"and nobody at Chromium did not think about this issue.

I've opened an issue last nigh about this on chromium bug tracker, I will let you know if they intend to correct it or not.

I will also think about some workaround that could be used in case they don't want to fix it and name it a "feature" instead of fixing it 😜.

Like I said I'm not really good at JS but I'm fairly good with pseudo code/logic and debugging issues, in the past I've programmed in many other languages and made the pseudo code for many project in Assembly language that's why I can understand how the code work and what can be done or not even if I'm not pro-efficient in JS.

But I intend to follow some basic course about JS to have a better understanding of the basic and lose less time when I try fo fix simple extensions/addons to better suit my need or repair them if they are abandoned.

since then we'll be retaining screenshots indefinitely

Where the screenshot are stored ? Which DB is used ? 🤔

If there's a way to differentiate between discarded and closed then great, that's probably doable (although what if you discard a tab and then close it - does the close event occur?)

I will look at that on my side to find a way/logic if Chromium don't intend to fix the issue on their side which would be lot easy for all extension devs.

I will be back later today or tomorrow with more news about the issue I have opened on chromium tracker.

Regards :octocat:

@mikhoul
Copy link

mikhoul commented Jun 13, 2018

@akhaku Here's the URL for the issue I've opened: https://bugs.chromium.org/p/chromium/issues/detail?id=852239

Maybe you could add more details than me and even a test case in JS to demonstrate clearly the issue... Maybe just a basic extension that fire and alert with "onRemoved" so it will be easy to trigger with an extension like The Great Discarder and demonstrate the issue.

Regards :octocat:

@akhaku
Copy link
Owner

akhaku commented Jul 8, 2018

We actually store screenshots in memory, in a javascript object scoped to the background window. This means that when you close your browser window (or refresh the plugin, or anything like that), the stored screenshots will disappear. I prefer that to storing it in localStorage or one of the html5 databases, since it makes cleanup simpler.
Thanks for reporting the issue to Chrome - if they release a new API that lets us listen to it, I can update the plugin to integrate with it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants