diff --git a/dom/base/nsGlobalWindowInner.cpp b/dom/base/nsGlobalWindowInner.cpp index d17fcecb210b..f2621cf7426b 100644 --- a/dom/base/nsGlobalWindowInner.cpp +++ b/dom/base/nsGlobalWindowInner.cpp @@ -2813,14 +2813,7 @@ bool nsGlobalWindowInner::DoResolve( // We support a cut-down Components.interfaces in case websites are // using Components.interfaces.nsIFoo.CONSTANT_NAME for the ones // that have constants. - static bool watchingComponentsPref = false; - static bool useComponentsShim = false; - if (!watchingComponentsPref) { - watchingComponentsPref = true; - Preferences::AddBoolVarCache(&useComponentsShim, "dom.use_components_shim", - true); - } - if (useComponentsShim && + if (StaticPrefs::dom_use_components_shim() && aId == XPCJSRuntime::Get()->GetStringID(XPCJSContext::IDX_COMPONENTS)) { return ResolveComponentsShim(aCx, aObj, aDesc); } diff --git a/modules/libpref/init/StaticPrefList.yaml b/modules/libpref/init/StaticPrefList.yaml index 50052deea55c..914d6f6c4c77 100644 --- a/modules/libpref/init/StaticPrefList.yaml +++ b/modules/libpref/init/StaticPrefList.yaml @@ -2664,6 +2664,12 @@ value: 5000 mirror: always +# Whether to shim a Components object on untrusted windows. +- name: dom.use_components_shim + type: bool + value: @IS_NOT_NIGHTLY_BUILD@ + mirror: always + - name: dom.vibrator.enabled type: bool value: true diff --git a/modules/libpref/init/all.js b/modules/libpref/init/all.js index f0836493403b..25bb7e0dbb4b 100644 --- a/modules/libpref/init/all.js +++ b/modules/libpref/init/all.js @@ -1055,13 +1055,6 @@ pref("dom.select_popup_in_parent.enabled", false); pref("dom.cycle_collector.incremental", true); -// Whether to shim a Components object on untrusted windows. -#ifdef NIGHTLY_BUILD - pref("dom.use_components_shim", false); -#else // NIGHTLY_BUILD - pref("dom.use_components_shim", true); -#endif // NIGHTLY_BUILD - // Disable popups from plugins by default // 0 = openAllowed // 1 = openControlled