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!

Ce site disposera de fonctionnalités limitées pendant que nous effectuons des opérations de maintenance en vue de vous proposer un meilleur service. Si un article ne règle pas votre problème et que vous souhaitez poser une question, notre communauté d’assistance est prête à vous répondre via @FirefoxSupport sur Twitter, et /r/firefox sur Reddit.

Rechercher dans l’assistance

Évitez les escroqueries à l’assistance. Nous ne vous demanderons jamais d’appeler ou d’envoyer un SMS à un numéro de téléphone ou de partager des informations personnelles. Veuillez signaler toute activité suspecte en utilisant l’option « Signaler un abus ».

En savoir plus

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

  • 3 réponses
  • 1 a ce problème
  • 1 vue
  • Dernière réponse par 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.

Solution choisie

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

Lire cette réponse dans son contexte 👍 1

Toutes les réponses (3)

more options

Solution choisie

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