Join the AMA (Ask Me Anything) with the Firefox leadership team to celebrate Firefox 20th anniversary and discuss Firefox’s future on Mozilla Connect. Mark your calendar on Thursday, November 14, 18:00 - 20:00 UTC!

Този сайт ще има ограничена функционалност, докато се извършва тече неговата поддръжка. Ако дадена статия не може реши проблема ви и искате да зададете въпрос, нашата общност е готова да ви помогне на @firefox в Twitter и /r/firefox в Reddit.

Търсене в помощните статии

Избягвайте измамите при поддръжката. Никога няма да ви помолим да се обадите или изпратите SMS на телефонен номер или да споделите лична информация. Моля, докладвайте подозрителна активност на "Докладване за злоупотреба".

Научете повече

How can I disable the display of the word "PLAYING" in the tab of a page that is playing media?

  • 3 отговора
  • 1 има този проблем
  • 1 изглед
  • Последен отговор от cor-el

more options

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.

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 <img> of the music score beside the HTML5 <audio> controls. The height of the <img> 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)

more options

Избрано решение

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".

more options

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.

more options

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])
);