How can I disable the display of the word "PLAYING" in the tab of a page that is playing media?
When I play HTML5 audio Firefox adds an extra line to the tab title with the word "PLAYING". This causes the main window to resize vertically. Any content that is sized based on the height of the window is also resized which causes a visible 'glitch' in the display. My specific use-case is a music rehearsal page that displays an SVG of the music score beside the HTML5 <audio> controls. The height of the is defined, in css, as 'height: 100vh;' so that the whole page is visible. I would like to be able to revert to Firefox's previous behaviour of displaying an icon _beside_ the tab title. Any other solution that does not increase the height of the tab could also be of use.
Thanks.
被采纳的解决方案
You can hide the secondary line that shows the Playing and Muted state by modifying the browser.tabs.secondaryTextUnsupportedLocales pref and add your language to the list. For "en-US" this would be "en" (i.e. the part before the '-'):
- ar,bn,bo,ckb,fa,gu,he,hi,ja,km,kn,ko,lo,mr,my,ne,pa,si,ta,te,th,ur,zh,en
You can open the about:config page via the location/address bar. You can click the button to "Accept the Risk and Continue".
定位到答案原位置 👍 1所有回复 (3)
选择的解决方案
You can hide the secondary line that shows the Playing and Muted state by modifying the browser.tabs.secondaryTextUnsupportedLocales pref and add your language to the list. For "en-US" this would be "en" (i.e. the part before the '-'):
- ar,bn,bo,ckb,fa,gu,he,hi,ja,km,kn,ko,lo,mr,my,ne,pa,si,ta,te,th,ur,zh,en
You can open the about:config page via the location/address bar. You can click the button to "Accept the Risk and Continue".
Thanks very much cor-el! That fixes the problem.
It does, however, seem like a bit of a hack using locale. I had already looked through the browser.tabs prefs but none of them seemed to be relevant. Would it be possible to add a preference like browser.tabs.secondaryTextEnabled? That would make more sense to me. Perhaps there could be a number of browser.tabs.secondaryText.* preferences.
Anyway, just a few thoughts. Thanks again.
This pref is specially created for locales that have problem with displaying the secondary text:
// Hide the secondary text for locales where it is unsupported due to size constraints. const language = Services.locale.appLocaleAsBCP47; const unsupportedLocales = Services.prefs.getCharPref( "browser.tabs.secondaryTextUnsupportedLocales" ); this.toggleAttribute( "secondarytext-unsupported", unsupportedLocales.split(",").includes(language.split("-")[0]) );