VOOZH about

URL: https://phabricator.services.mozilla.com/D299541

⇱ ⚙ D299541 Bug 1803078 - Add Pref to expose media metadata in private browsing


Bug 1803078 - Add Pref to expose media metadata in private browsing
ClosedPublic

Authored by ahmubashshir on May 9 2026, 3:07 PM.
Referenced Files
Unknown Object (File)
Sun, Jun 14, 12:48 AM
Unknown Object (File)
Tue, Jun 9, 8:24 AM
Unknown Object (File)
Thu, Jun 4, 8:25 AM
Unknown Object (File)
Thu, Jun 4, 7:14 AM
Unknown Object (File)
Thu, Jun 4, 1:09 AM
Unknown Object (File)
Thu, Jun 4, 12:19 AM
Unknown Object (File)
Thu, Jun 4, 12:16 AM
Unknown Object (File)
Wed, Jun 3, 7:11 PM
Subscribers

Details

Summary

Add a new pref, , to control
whether media metadata is exposed in Private Browsing mode.

Signed-off-by: Mubashshir <ahmubashshir@gmail.com>

Diff Detail

Event Timeline

ahmubashshir created this revision.
phab-bot changed the visibility from "Custom Policy" to "Public (No Login Required)".May 9 2026, 3:07 PM
phab-bot changed the edit policy from "Custom Policy" to "Restricted Project (Project)".
phab-bot removed a project: secure-revision.
Comment Actions

Summarization

Intent

The changes aim to address a user request to allow media metadata (such as track title, artist, and album information) to be exposed through system media controls (e.g., MPRIS on Linux) even when the user is in private browsing mode. By default, Firefox suppresses this metadata in private browsing to protect user privacy, but some users may prefer the convenience of seeing media information in their system's media controls regardless of the browsing mode. This patch introduces a preference that lets users opt in to this behavior.

Solution

The solution introduces a new boolean preference, , defaulting to (preserving the existing privacy-respecting behavior). When this preference is set to , the code in that determines whether media metadata should be hidden (by checking if the document is in private browsing) is effectively bypassed. Specifically, in the method that checks whether metadata should be blocked for private browsing contexts, the new code checks the preference value before evaluating the private browsing state of the document. If the preference is enabled, the method returns early (indicating metadata should be exposed), skipping the subsequent private browsing check that would otherwise suppress the metadata. This gives users explicit control over whether their media metadata is visible in system media interfaces during private browsing sessions.


Please use / reactions on inline comments to provide feedback. This will have a significant impact on the quality of future reviews.
dom/media/mediacontrol/MediaStatusManager.cpp
522

Bug: The return value is inverted. The caller at line 468 uses , so returning here means the metadata will still be hidden. To expose metadata when the pref is enabled, this must .

modules/libpref/init/StaticPrefList.yaml
11861

Add a description comment above this pref entry, similar to other prefs in this file. Something like: .

Comment Actions

Fix logic bug and update doc comment

modules/libpref/init/StaticPrefList.yaml
11836

The comment should explicitly note that enabling this pref weakens a privacy protection — e.g.,

11838

The pref name is ambiguous — it reads as "private browsing metadata is enabled" which could mean the privacy *protection* is enabled, when in reality means the opposite: metadata is *exposed* despite private browsing. A clearer name would be something like or .

11839

Since this pref is checked on the main thread (from the media session/status manager path), a plain with would suffice and avoids the unnecessary atomic overhead. Use only if there are off-main-thread readers.

ahmubashshir added a reviewer: alwu.
This revision is now accepted and ready to land.May 11 2026, 10:05 PM
alwu retitled this revision from WIP: Bug 1803078 - Add Pref to expose media metadata in private browsing to Bug 1803078 - Add Pref to expose media metadata in private browsing.May 11 2026, 10:07 PM
alwu edited the summary of this revision. (Show Details)
ahmubashshir edited the summary of this revision. (Show Details)
ahmubashshir edited the summary of this revision. (Show Details)
This revision was landed with ongoing or failed builds.May 12 2026, 7:58 PM
This revision was automatically updated to reflect the committed changes.

Revision Contents

PathSize
dom/
media/
mediacontrol/
3 lines
modules/
libpref/
init/
7 lines
CommitTreeParentsAuthorSummaryDate
1361ccb99a934b17cf8fb98eMubashshir
Bug 1803078 - Add Pref to expose media metadata in private browsing r=alwu (Show More…)

Diff 1273085

dom/media/mediacontrol/MediaStatusManager.cpp

Loading...

modules/libpref/init/StaticPrefList.yaml

Loading...