tor-browser

The Tor Browser
git clone https://git.dasho.dev/tor-browser.git
Log | Files | Refs | README | LICENSE

commit d7a9ac19eeaae68f1ac1df60092d1ecda855078d
parent 052c86d22f40fac0089c7990fdc2c73beab63b33
Author: Jared Wein <jwein@mozilla.com>
Date:   Tue, 18 Nov 2025 21:34:09 +0000

Bug 1972078 - Convert DRM Content (Media) to config-based prefs r=mstriemer

Differential Revision: https://phabricator.services.mozilla.com/D272683

Diffstat:
Mbrowser/components/preferences/main.inc.xhtml | 13++++---------
Mbrowser/components/preferences/main.js | 41++++++++++++++++++++++++++++-------------
2 files changed, 32 insertions(+), 22 deletions(-)

diff --git a/browser/components/preferences/main.inc.xhtml b/browser/components/preferences/main.inc.xhtml @@ -439,15 +439,10 @@ <!-- DRM Content --> <groupbox id="drmGroup" data-category="paneGeneral" data-subcategory="drm" hidden="true"> - <label><html:h2 data-l10n-id="drm-content-header"/></label> - <hbox align="center"> - <checkbox id="playDRMContent" preference="media.eme.enabled" - class="tail-with-learn-more" data-l10n-id="play-drm-content" /> - <html:a is="moz-support-link" - data-l10n-id="play-drm-content-learn-more" - support-page="drm-content" - /> - </hbox> + <label class="section-heading"> + <html:h2 data-l10n-id="drm-content-header"/> + </label> + <html:setting-group groupid="drm" /> </groupbox> <hbox id="updatesCategory" diff --git a/browser/components/preferences/main.js b/browser/components/preferences/main.js @@ -534,6 +534,23 @@ Preferences.addSetting({ AppConstants.MOZ_WIDGET_GTK, }); Preferences.addSetting({ + id: "playDRMContent", + pref: "media.eme.enabled", + visible: () => { + if (!Services.prefs.getBoolPref("browser.eme.ui.enabled", false)) { + return false; + } + if (AppConstants.platform == "win") { + try { + return parseFloat(Services.sysinfo.get("version")) >= 6; + } catch (ex) { + return false; + } + } + return true; + }, +}); +Preferences.addSetting({ id: "cfrRecommendations", pref: "browser.newtabpage.activity-stream.asrouter.userprefs.cfr.addons", }); @@ -1459,6 +1476,16 @@ SettingGroupManager.registerGroups({ }, ], }, + drm: { + subcategory: "drm", + items: [ + { + id: "playDRMContent", + l10nId: "play-drm-content", + supportPage: "drm-content", + }, + ], + }, browsing: { l10nId: "browsing-group-label", items: [ @@ -2357,6 +2384,7 @@ var gMainPane = { // Initialize settings groups from the config object. initSettingGroup("appearance"); initSettingGroup("downloads"); + initSettingGroup("drm"); initSettingGroup("browsing"); initSettingGroup("zoom"); initSettingGroup("performance"); @@ -2521,19 +2549,6 @@ var gMainPane = { fxtranslationRow.hidden = false; } - let emeUIEnabled = Services.prefs.getBoolPref("browser.eme.ui.enabled"); - // Force-disable/hide on WinXP: - if (navigator.platform.toLowerCase().startsWith("win")) { - emeUIEnabled = - emeUIEnabled && parseFloat(Services.sysinfo.get("version")) >= 6; - } - if (!emeUIEnabled) { - // Don't want to rely on .hidden for the toplevel groupbox because - // of the pane hiding/showing code potentially interfering: - document - .getElementById("drmGroup") - .setAttribute("style", "display: none !important"); - } // Initialize the Firefox Updates section. let version = AppConstants.MOZ_APP_VERSION_DISPLAY;