Total-Suspender-webextension icon indicating copy to clipboard operation
Total-Suspender-webextension copied to clipboard

[Feature Request] Only pausing all scripts for inactive tabs as a first phase in suspending.

Open LichenSymbiont opened this issue 4 years ago • 3 comments

I think it's too aggressive to start suspending things that take up little RAM and little processing.

Things like NoScript can block all scripts for a site, but it's for blocking obviously useless third-party scripts. It doesn't care if something's laying in the background doing stuff when it's completely useless. Scripts should only do useful stuff for the user, or they should be put on hold.

And with the criterion this addon uses, it could more smoothly phase out tabs by instantly stopping their scripts when not active or playing media.

But as it is right now, this addon seems to be working the best.

LichenSymbiont avatar Jul 13 '19 17:07 LichenSymbiont

I get the point of stopping scripts that waste CPU time as the first phase in suspending. As far as I know, firefox now doesn't have an accessible way a webextension can calculate the amount of RAM used and CPU load of a tab, like performance.memory. So, there is no way to, like, sort tabs based on it. about:memory and about:performance do exist, though, about:performance takes about ~100MB of RAM itself and uses CPU excessively, so even if I could inject content script in this tab and update tabs memory and CPU stats it would have negated the purpose of the extension, that is, to reduce memory and time consumption. As for the discarding process, native discarding already stops scripts and stores tabs' data to the cache.

k5md avatar Jul 14 '19 10:07 k5md

about:performance takes about ~100MB of RAM itself and uses CPU excessively

Yes, FF needs to get a lot of stuff sorted. But I think having access to tabs RAM and CPU usage is definitely an essential feature. You could even make a more efficient task manager for FF with a popup/dropdown box instead of having to open a new tab.

As for the discarding process, native discarding already stops scripts and stores tabs' data to the cache.

Hmm... Yes, but I still notice some tabs are reloading data from the web. I wonder if there's a way for FF to do more extensive caching, perhaps just increase cache storage space? and if so, it would be good to recommend the users of the addon to increase cache for best performance.

But you're right, I've queried uMatrix and NoScript developers to do it instead. As they deal with scripts extensively. And it would be a more proper place. Though the most proper place is in FF itself, or at least making it easy to stop scripts for extension developers. I posted it here: bugzilla.mozilla.org/show_bug.cgi?id=1545701

LichenSymbiont avatar Jul 14 '19 10:07 LichenSymbiont

Background script processing could be disabled without finding out the RAM or CPU usage. That is actually the functionality I am looking for - like an instant NoScript for all background tabs.

zwn avatar Jun 15 '20 15:06 zwn