8000 Pause the timer for all tabs when tabCount <= minTabCount · Issue #35 · qzb/dustman · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Pause the timer for all tabs when tabCount <= minTabCount #35

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

Open
furkanarabaci opened this issue Jan 31, 2018 · 2 comments
Open

Pause the timer for all tabs when tabCount <= minTabCount #35

furkanarabaci opened this issue Jan 31, 2018 · 2 comments

Comments

@furkanarabaci
Copy link

Problem : When you have <=5 ( at default ) tabs inactive for longer than 20 minutes ( default ) and when opened 6th tab, the first tab that went inactive for 20 minutes is closed instantly.

What should be happening : Only schedule tabs for closing when you have >5 tabs and stop timer when <=5 tabs.

I will try fixing this myself. If i am successful, i will make PR.

@mbid
Copy link
Collaborator
mbid commented Feb 1, 2018

Hi there,
I actually like the current behavior, but I'd gladly merge a PR that allows setting an appropriate flag in the settings.

The problem is that I don't want to change the architecture of the addon significantly for this. But I think there is a way to implement it. Currently, the addon determines whether a tab should be discarded via firefox's built-in tabs.tab lastAccessed field, see here: https://github.com/qzb/dustman/blob/master/lib/autoclose.js#L39-L49

If you can implement this feature without changing the whole architecture, go ahead. I think the easiest way would be to keep track of times when only n tabs have been open recently, and then add the sum of these times in the comparison here.

I don't want to merge a solution that polls the browser every few seconds to check for tab status. The addon is comparatively lightweight currently and I'd like to keep it that way.

@furkanarabaci
Copy link
Author

Well, i tried. The problem is, algorithm only relies on current time and lastAccessed time as you provided. There is nothing to stop in the first place. I thought of adding timer; starts at lastAccessed and ends at minInactiveMilliseconds. But only ticks if numTabsToClose>0.

The easiest way would be this, but it gives answer to " Does it really necessary" question a big no. It is O.K the way it is, but i will try implementing this at near future, maybe without changing the architecture.

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

No branches or pull requests

3 participants
0