Firefox-UI-Fix icon indicating copy to clipboard operation
Firefox-UI-Fix copied to clipboard

Sleep mode for inactive tabs

Open Nomes77 opened this issue 4 years ago • 3 comments

Is your feature request related to a problem? Some sort of battery saver or sleep mode for in active tabs like Microsoft Edge has currently. To make the browser faster. The solution I'd like Some sort of battery saver or sleep mode for in active tabs like Microsoft Edge has currently. Alternatives I've considered None, becease add-ons like Auto Tab Discard discard tabs. This forces the browser to reload the discarded tabs which cost even more performance resources. Additional context https://github.com/black7375/Firefox-UI-Fix/issues/2#issue-870942029

* [ ]  Battery saver

Nomes77 avatar Nov 02 '21 12:11 Nomes77

I think the frame rate and animation control will probably have the biggest impact on the battery saver. I'm investigating various other methods (Autoplay, Tab Lazy Load, JS Timer), but I'm not sure if it's possible to adjust the timer for specific tabs.

If we could implement an edge-like sleeping tab, it would be a killer feature.

black7375 avatar Nov 02 '21 12:11 black7375

I don't know exactly the sleeping tab function in edge works, but maybe we can implement a feature that would disable running background JS on tabs which aren't used.

Nomes77 avatar Nov 02 '21 18:11 Nomes77

just ref for sleeping tabs

https://techcommunity.microsoft.com/t5/articles/sleeping-tabs-faq/m-p/1705434 How does the sleeping tabs technology work?

Sleeping tabs builds upon the core of Chromium’s “freezing” technology. Freezing pauses a tab’s script timers, minimizing CPU usage and frees up the operating system to reuse the memory for other open tabs, new tabs, or system applications.

One implementation method is to use Dev tools' stop button command. (breakOnNext, resume) image

  • https://github.com/mozilla/gecko-dev/blob/1e7f7235cf822e79cd79ba9e200329ede3d37925/devtools/client/debugger/src/components/SecondaryPanes/CommandBar.js
  • https://github.com/mozilla/gecko-dev/blob/1e7f7235cf822e79cd79ba9e200329ede3d37925/devtools/client/debugger/src/actions/pause/commands.js
  • https://github.com/mozilla/gecko-dev/blob/1e7f7235cf822e79cd79ba9e200329ede3d37925/devtools/client/debugger/src/actions/pause/paused.js

black7375 avatar Nov 03 '21 01:11 black7375