Tab Audio Indicators

Talk about code development, features, specific bugs, enhancements, patches, and similar things.
Forum rules
Please keep everything here strictly on-topic.
This board is meant for Pale Moon source code development related subjects only like code snippets, patches, specific bugs, git, the repositories, etc.

This is not for tech support! Please do not post tech support questions in the "Development" board!
Please make sure not to use this board for support questions. Please post issues with specific websites, extensions, etc. in the relevant boards for those topics.

Please keep things on-topic as this forum will be used for reference for Pale Moon development. Expect topics that aren't relevant as such to be moved or deleted.
adisib
Lunatic
Lunatic
Posts: 380
Joined: 2015-06-13, 03:34
Location: KY

Tab Audio Indicators

Unread post by adisib » 2015-07-26, 06:03

Back during one of the times I switched from Chrome back to Firefox, one thing that I immediately missed was the tab audio indicators. Searching for a Firefox solution, I found only the article stating its dependance on Chrome's own flash implementation:
http://www.ghacks.net/2014/01/15/main-r ... s-firefox/

Very recently though, I've seen a new one stating that Firefox is working on the feature and might have some progress very soon:
http://venturebeat.com/2015/07/24/firef ... mute-them/

Surprisingly, instead of following Chrome's method it was stated in the Bugzilla entry comments that Flash 18 actually makes this possible for flash now, instead of just HTML5 and Shumway. This means it should be possible for Pale Moon as well.

The only plugin I found for HTML5 audio indicators isn't compatible with Pale Moon. This is a sorely missed feature from my Chrome days to track down intrusive ads and quickly re-find video tabs amongst many, and shouldn't be a pro for Firefox over Pale Moon. Unfortunately its likely that Mozilla's implementation could be tied into e10s. Would Pale Moon be able to implement flash audio indicators or consider at least HTML5 audio indicators?

User avatar
Moonchild
Pale Moon guru
Pale Moon guru
Posts: 35576
Joined: 2011-08-28, 17:27
Location: Motala, SE
Contact:

Re: Tab Audio Indicators

Unread post by Moonchild » 2015-07-26, 13:41

It shouldn't be too hard to convert this add-on to a Pale Moon compatible one.

The core function is:

Code: Select all

function checkNoise() {
let hasNoise = Array.some(
document.querySelectorAll("audio, video"),
v => !v.paused && v.mozHasAudio && !v.muted && v.volume
);
self.port.emit("hasNoise", hasNoise);
}
Meaning it checks for <audio> and <video> elements on the page, and checks if they have certain parameters (playing, not muted, volume not 0) if found. if so, it's flagged as "has noise" and adds an indicator. Mozilla's approach to this feature request is terrible and absolutely unportable to Pale Moon.
"Sometimes, the best way to get what you want is to be a good person." -- Louis Rossmann
"Seek wisdom, not knowledge. Knowledge is of the past; wisdom is of the future." -- Native American proverb
"Linux makes everything difficult." -- Lyceus Anubite

Supernova

Re: Tab Audio Indicators

Unread post by Supernova » 2015-07-26, 20:49

Even if this cover obviously only html5 audio ; this way to answer the request looks simple & efficient. A port as a PM-compatible add-on would be good, but may we expect in the future that this will make its way into the core ? (With I guess a config option or two)

jangdonggun1234
Fanatic
Fanatic
Posts: 104
Joined: 2013-06-06, 01:29

Re: Tab Audio Indicators

Unread post by jangdonggun1234 » 2015-07-27, 18:00

If possible I think we should consider make this feature a built-in feature, knowing which tab is making noisy will help user alot, there is websites that use some adult sound, and those sound will give us trouble if our mother/father/daughter hear those. At least we can react faster and shut it up.

An example: http://comic.naver.com/webtoon/detail.n ... eekday=tue

User avatar
LimboSlam
Board Warrior
Board Warrior
Posts: 1029
Joined: 2014-06-09, 04:43
Location: USA

Re: Tab Audio Indicators

Unread post by LimboSlam » 2015-07-28, 03:20

Yes I agree, this would be a very useful feature to implement into Pale Moon! Maybe an automatic pause/stop function when other media/audio is playing at the same time. For instance, when I have Pandora playing on my Android and have a YouTube video that I want view, my Android automatically pauses Pandora and then stats playing YouTube, visa versa. It does the same with adds that starts up playing media/audio.

EDIT:This should be an add-on because this already accessible in about:config, and it's called media.autoplay.enabled. No need for extra functionality when media.autoplay.enabled hits two birds with one stone.
Last edited by LimboSlam on 2015-11-30, 06:08, edited 2 times in total.
With Pale Moon by my side, surfing the web is quite enjoyable and takes my headaches away! :)
God is not punishing you, He is preparing you. Trust His plan, not your pain.#‎TrentShelton #‎RehabTime

Tyestor

Re: Tab Audio Indicators

Unread post by Tyestor » 2015-08-21, 23:41

Sorry to bump the thread but Firefox Nightly has this now, I don't know which version it was implemented but it's worth taking a look at.

jangdonggun1234
Fanatic
Fanatic
Posts: 104
Joined: 2013-06-06, 01:29

Re: Tab Audio Indicators

Unread post by jangdonggun1234 » 2015-08-22, 06:48

It is very easy to have this feature ? Can you write Userscript ?
We can simply write a very very simple script that check if a page contains video/audio/object/embed tag, if condition met that script will write a button into the webpage and we can use that button to turn on/off audio. the easiest way is just remove the whole video/audio/object/embed tag. That is my idea.

squarefractal

Re: Tab Audio Indicators

Unread post by squarefractal » 2015-08-22, 09:08

You can have this feature with Noscript, setting it to accept scripts globally and putting restrictions on embeddings on whitelisted sites, and selecting Forbid audio/video in the embeddings tab. For websites for which you want that these media should be automatically allowed, you can set *@<regex_matching_hostname> in noscript.allowedMimeRegexp.

Darwel

Re: Tab Audio Indicators

Unread post by Darwel » 2015-11-29, 17:42

Hi everyone,

I just switched from Firefox to Pale Moon and so far, it's a blast. Let me ressurect this older thread - I seem to miss just one thing, but I miss it hard - audio tab indicator. Is there any chance Pale Moon will include this feature in the (near) future? Not that I'll go back to Firefox, but this is a huge inconvenience and I'd be very happy about this function in PM.

Thanks very much!

User avatar
LimboSlam
Board Warrior
Board Warrior
Posts: 1029
Joined: 2014-06-09, 04:43
Location: USA

Re: Tab Audio Indicators

Unread post by LimboSlam » 2015-11-30, 06:00

This seems like a neat feature to be added, but it really should be add-on. Why? Well because this is already accessible in about:config, and it's called media.autoplay.enabled. No need for extra functionality when media.autoplay.enabled (toggle to false to take effect) hits two birds with one stone, right.
With Pale Moon by my side, surfing the web is quite enjoyable and takes my headaches away! :)
God is not punishing you, He is preparing you. Trust His plan, not your pain.#‎TrentShelton #‎RehabTime

adisib
Lunatic
Lunatic
Posts: 380
Joined: 2015-06-13, 03:34
Location: KY

Re: Tab Audio Indicators

Unread post by adisib » 2015-11-30, 21:19

LimboSlam wrote:Well because this is already accessible in about:config, and it's called media.autoplay.enabled.
This setting is not related to the request. The request is for indicators, which that setting does not give, and the indicators should be present for playing media, regardless of whether it was activated by the user or not (e.g. many different media tabs among many more tabs, with an indicator making it easy to return to the media tab that is currently playing).

I very badly miss the indicators, but I for sure do not want to disable the autoplay of media.

Exagone313

Re: Tab Audio Indicators

Unread post by Exagone313 » 2016-01-15, 16:51

I'm also interested to this, I've read the FF Bugzilla and I don't really understand how to find the pushes associated to this bugzilla thread...

Lord_Brezel

Re: Tab Audio Indicators

Unread post by Lord_Brezel » 2016-01-29, 02:46

Hell yeah, per Tab Audio Indicators would be sweet!

Weishaupt

Re: Tab Audio Indicators

Unread post by Weishaupt » 2016-10-08, 08:27

Any change of us getting that nice feature anytime soon? :)

User avatar
Moonchild
Pale Moon guru
Pale Moon guru
Posts: 35576
Joined: 2011-08-28, 17:27
Location: Motala, SE
Contact:

Re: Tab Audio Indicators

Unread post by Moonchild » 2016-10-08, 22:46

Weishaupt wrote:Any change of us getting that nice feature anytime soon? :)
It currently doesn't have priority, but if anyone feels an itch to work on this and contribute, it'll be more than welcome!
"Sometimes, the best way to get what you want is to be a good person." -- Louis Rossmann
"Seek wisdom, not knowledge. Knowledge is of the past; wisdom is of the future." -- Native American proverb
"Linux makes everything difficult." -- Lyceus Anubite

adisib
Lunatic
Lunatic
Posts: 380
Joined: 2015-06-13, 03:34
Location: KY

Re: Tab Audio Indicators

Unread post by adisib » 2016-10-09, 20:41

Since it isn't being worked on, I might as well share a greasemonkey script to add audio indicator functionality that I made a while ago.

This is something that SHOULD be an extension, but I don't know anything about writing extensions for Pale Moon or see easy access resources for it. As such you can't use it to mute tabs, and you are stuck with a silly unicode music note as the indicator. If someone wants to use my quickly-written code in making an extension, they are more than welcome.

https://gist.github.com/adisib/6b0eac4e ... 60d9d8edc7

_yuyu_
Lunatic
Lunatic
Posts: 253
Joined: 2015-03-02, 14:18

Re: Tab Audio Indicators

Unread post by _yuyu_ » 2016-10-13, 22:32

adisib wrote:Since it isn't being worked on, I might as well share a greasemonkey script to add audio indicator functionality that I made a while ago.

This is something that SHOULD be an extension, but I don't know anything about writing extensions for Pale Moon or see easy access resources for it. As such you can't use it to mute tabs, and you are stuck with a silly unicode music note as the indicator. If someone wants to use my quickly-written code in making an extension, they are more than welcome.

https://gist.github.com/adisib/6b0eac4e ... 60d9d8edc7
Thanks for sharing! It does work on many sites. Does nothing on Youtube, Soundcloud, Yandex music etc... Is that because some sites announce their media content in the page code in a special way? Or HTML5 <> Flash?
Pale Moon 32-bit on Win 7 x64

adisib
Lunatic
Lunatic
Posts: 380
Joined: 2015-06-13, 03:34
Location: KY

Re: Tab Audio Indicators

Unread post by adisib » 2016-10-13, 23:15

_yuyu_ wrote: Thanks for sharing! It does work on many sites. Does nothing on Youtube, Soundcloud, Yandex music etc... Is that because some sites announce their media content in the page code in a special way? Or HTML5 <> Flash?
It works perfectly on youtube for me. It only works with HTML5 elements. It does NOT work for Flash. If you are using Flash on youtube, it wont work.

User avatar
Moonchild
Pale Moon guru
Pale Moon guru
Posts: 35576
Joined: 2011-08-28, 17:27
Location: Motala, SE
Contact:

Re: Tab Audio Indicators

Unread post by Moonchild » 2016-10-13, 23:54

FTR: something like this can, by its very nature, only work on html5 audio/media -- the browser simply cannot know that a plugin does with its own code talking to the OS's audio subsystems.
"Sometimes, the best way to get what you want is to be a good person." -- Louis Rossmann
"Seek wisdom, not knowledge. Knowledge is of the past; wisdom is of the future." -- Native American proverb
"Linux makes everything difficult." -- Lyceus Anubite

_yuyu_
Lunatic
Lunatic
Posts: 253
Joined: 2015-03-02, 14:18

Re: Tab Audio Indicators

Unread post by _yuyu_ » 2016-10-14, 00:34

adisib; Moonchild
thank you.
Pale Moon 32-bit on Win 7 x64

Locked