autonome / Dormancy

Firefox add-on that frees inactive tabs from memory, restoring their contents next time you access the tab.
47 stars 14 forks source link

Exclude tabs with audio output #21

Closed rugk closed 5 years ago

rugk commented 6 years ago

IMHO when you listen to a podcast or so, you would not want that to stop, just because that tab is in the background.

autonome commented 6 years ago

I tentatively agree with this.

Given that browsers have visual indicators of tab audio activity now, it's safer than it used to be to assume the audio is intentional and desired. Use cases like listening to music in a background tab that is not pinned will be addressed.

Challenges and downsides:

On Sun, Apr 1, 2018 at 6:03 AM rugk notifications@github.com wrote:

IMHO when you listen to a podcast or so, you would not want that to stop, just because that tab is in the background.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/autonome/Dormancy/issues/21, or mute the thread https://github.com/notifications/unsubscribe-auth/AADDt0UkjTv6N9qsjXAvEz5RStZUuF4kks5tkNAugaJpZM4TC0r4 .

rugk commented 6 years ago

Audio means more resource consumption, so not hibernating those tabs works against some of the use cases for hibernating tabs in the first places

Well, of course, but it suits nobody to have your podcast stopped in the middle (and begin again when restored)…

If you really care, make an option/setting, so users can disable it, if they want.

leplatrem commented 6 years ago

I think this is very similar to #10 and maybe solved easily with #7

rugk commented 6 years ago

I don't think #7 would help very much, because unlike webrtc I may really use many, many different websites and they may also contain a video/podcast on some pages, but not on all of them. So a setting for "exclude tabs, which emit sound" may be useful.

BTW are PRs accepted for this? Then I may get to get my hand on this issue.

rugk commented 6 years ago

Just saw this should be possible:

ole-tange commented 6 years ago

I would prefer a simple way of whitelisting a tab; maybe by clicking an icon next to the location bar.

The reason is that I know what tabs I want to whitelist (i.e. my podcast tab), but there may be many tabs that plays a sound now and then, and I do not want them to be able to "decide" not to be unloaded. By having a whitelist button I remain in control.

rugk commented 6 years ago

but there may be many tabs that plays a sound now and then

What websites do you visit that do this stuff? IMHO if a website randomly plays a sound when being in the background this is a really bad website design and I would just leave this website, as it would totally annoy me. Also, playing a sound "now and then" is not enough, it has to play the sound constantly, i.e. play music or something "long".

I remain in control

In Firefox you can clearly see which tabs are playing sound and thus you know what is "whitelisted".

As for everything else, I think https://github.com/autonome/Dormancy/issues/7 is the issue you want.

ole-tange commented 6 years ago

What websites do you visit that do this stuff?

Microsoft Outlook Web Access for one. When an email arrives or a reminder is shown it plays a sound. Firefox only shows the loudspeaker icon on the tab while it is playing. This is less than a second.

I would imagine several messaging services running in a browser will do the same.

rugk commented 6 years ago

Okay, so a sound does not affect the proposed change at all. The tab would only be "blacklisted" while it is playing this sound (i.e. while the sound icon is shown), i.e. in your case it practically would not matter. Note, that each trigger checks the requirements again, so you would have to be very unlucky to catch exactly the second the sound is played to prevent the tab from going to sleep.

See what I said before:

Also, playing a sound "now and then" is not enough, it has to play the sound constantly, i.e. play music or something "long".