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

Option to prevent suspension of tabs that are potentially producing sound #28

Closed
AndrewJDR opened this issue Feb 28, 2013 · 19 comments
Closed
Labels

Comments

@AndrewJDR
Copy link
Contributor

Sometimes, its nice to run soundcloud, rdio, youtube, etc in the background to play some music or other multimedia for an extended period. Ideally, there'd be some option to prevent auto suspension of a tab like this that is responsible for producing sound.

Such a feature could perhaps utilize the same technique that this extension is using to detect potentially sound producing tabs, or could perhaps even work in concert with this extension:
http://www.mutetab.com/

@mohanraj-r
Copy link

This might become easier as chrome might be getting a related feature and hopefully API in the near future:

Google Chrome Getting Audio Indicators for Tabs Making Sound

@deanoemcke
Copy link
Collaborator

I think I might leave this one for now. Adding these sites to the whitelist should be a fairly decent workaround for now.

@deanoemcke
Copy link
Collaborator

The latest webstore version now has the ability to 'temporarily pause suspension' for a site. If you have a tab open that is playing music and you do not want it to suspend, you can use this option to prevent it from suspending in the background.
I will not be doing any work in future to try and automatically detect tabs that are producing audio.

@deanoemcke
Copy link
Collaborator

Just to reiterate as this is one of the more commonly requested features. Chrome does not provide developer access to its ability to detect which tab is playing music. Therefore I am unable to include an option to prevent these tabs from suspending.
As an alternative, I have implemented an option in the popup call 'dont suspend for now' which will prevent the current tab from suspending automatically in the background. This can be used to prevent tabs that are playing audio from suspending.
Another alternative is to whitelist the url of the site if you'd like it to always remain unsuspended.

@dbkaplun
Copy link

Would you consider reopening this ticket if Chrome were to provide the ability to easily detect which tabs were playing audio? Maybe if you got a pull request?

@deanoemcke
Copy link
Collaborator

Definitely. I would love to have a dedicated option 'dont suspend tabs that are playing audio'.

@kirb
Copy link

kirb commented Jun 5, 2015

The content script could look for audio/video tags and check !element.paused. There could also be a catch-all setting for Flash/Silverlight as a hack (could still attempt to call !element.paused since the site might be using something like MediaElement.js). If anyone's insane enough to use Java for playback, it appears there's a Java API to detect that too. I don't think it's worth supporting the JS audio API because this is typically used for notification sounds/game sound effects.

It's not a perfect way to do it but considering many major sites are using <audio>/<video> now it might be an acceptable compromise.

Worth also looking at the MuteTab extension's FAQ.

Willing to put in the work for this if you'd like it.

@deanoemcke
Copy link
Collaborator

@kirb i have checked out mutetab, and it left me with the impression that there's just too much hackery involved in getting this feature working. i could definitely do as you suggested and catch a large percentage of the use-cases, but i'm worried that it would appear to be a buggy feature as it would not work consistently.
You're welcome to have a crack at it, and if it seems to work fairly reliably then i'd consider including it.

@deanoemcke deanoemcke reopened this Jun 8, 2015
@dbkaplun
Copy link

dbkaplun commented Jun 9, 2015

I think it would be acceptable if there was a "Do not suspend tabs that have audio or video" checkbox that simply checked if the page had any <audio> or <video> tags.

@maxxyme
Copy link

maxxyme commented Jun 17, 2015

I use theses websites to play music: SoundCloud, Mixcloud and YouTube.

@DanAtkinson
Copy link

Requires a development of the tabs extensions to allow this. For more information, see here for the Chromium issue.

@edmundo096
Copy link

I would like to see this soon. Its a great extension that deserves this.
Maybe add an "experimental-noted checkbox" which only checks for HTML5 <audio><video> tags, using what @kirb suggested (on his comment on Jun 5).

@deanoemcke
Copy link
Collaborator

If i was to implement this (highly considering it), what websites specifically should I be targetting? It seems that the audio/video !paused should be fairly easy. but with some quick tests this won't work for soundcloud or spotify. Any broad strokes I can make to detect flash audio/video? What about soundcloud? And are there other popular sites that I should be testing for?

@maxxyme
Copy link

maxxyme commented Sep 15, 2015

In addition to the 3 aforementioned websites, I would add:
Beatport.com (you can listen for free music there; the shop has moved to pro.beatport.com)
Hearthis.at
Hypem.com
Official.fm

@DanAtkinson
Copy link

The audible tab functionality has now been baked into Chrome 46. Specifically, you should be able to query tab.audible to return a boolean value of whether the tab has produced sound in the last couple of seconds.

More info on the API: https://developer.chrome.com/extensions/tabs

@deanoemcke
Copy link
Collaborator

Finally! This has now been implemented 👯

@infusion
Copy link

When is it planned to push out this feature?

@ForsakenHarmony
Copy link

Well now?

@deanoemcke
Copy link
Collaborator

Available in the chrome webstore in v6.30

@deanoemcke deanoemcke marked this as a duplicate of #470 Jul 25, 2017
barseghyanartur pushed a commit to barseghyanartur/tabsuspender that referenced this issue Feb 10, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

10 participants