MrOtherGuy / firefox-csshacks

Collection of userstyles affecting the browser
Mozilla Public License 2.0
3.24k stars 315 forks source link

inline_tab_audio_icons.css only show audio icon #333

Closed casualbugs closed 9 months ago

casualbugs commented 9 months ago

Hi Currently the css shows the speaker icon whenever playback is blocked.

I'd like it to only show the audio icon when something is playing with audio in the tab. The play icon showing doesn't serve much of a purpose for me.

Tried tweaking the script but couldn't get it to work.

Can you please help?

MrOtherGuy commented 9 months ago

What exactly do you see? I don't think I understand the situation you are facing. When I try the style, it will show a "play" icon in the tab if Firefox blocked automatic playback in that (background) tab.

  1. Go to youtube.com
  2. Hold Ctrl and click some video
  3. The video opens in a background tab

Results a "play" icon is shown and clicking it will start playback and the icon changes to "mute" icon.

I would imagine that if you have some extension blocking playback then this might not work because chances are that the extensions will stop the playback only after it has started - like in a first frame or something. I doubt there's anything you can do about that since technically the playback was stopped, not blocked.

casualbugs commented 9 months ago

Yes you are right. I am trying to replicate the behaviour of chrome

Scenario 1: Open new youtube link in a seprate tab Current Behaviour: Shows play icon Desired Beaviou: No play icon

Scenario 2: Video playing in a background tab Current and Desired behaviour: Show speaker icon

I am trying to remove the play icon completely when firefox blocks automatic playback. For me the speaker icon is useful in tracking down which tab is playing audio.

Hope this clarifies and thanks for the help!

MrOtherGuy commented 9 months ago

Alright, I see. In this case you can just add this to the style:

.tab-icon-overlay[activemedia-blocked]{ display: none }
casualbugs commented 9 months ago

Thanks that worked!