Bug 1830711 - Disable browser_style:true support in MV3 r=willdurand

Covered by the following test tasks in:
toolkit/components/extensions/test/xpcshell/test_ext_browser_style_deprecation.js
- unsupported_and_browser_style_true (supersedes supported_with_browser_style_true)
- unsupported_and_browser_style_false (supersedes supported_with_browser_style_false)
- unsupported_and_browser_style_default (supersedes supported_with_browser_style_default_false).

Differential Revision: https://phabricator.services.mozilla.com/D176813
This commit is contained in:
Rob Wu 2023-08-04 16:28:47 +00:00
parent dde35eb0cd
commit fd81207dc1
3 changed files with 2 additions and 12 deletions

View file

@ -1879,11 +1879,8 @@ pref("extensions.manifestV3.enabled", true);
// Install origins restriction. // Install origins restriction.
pref("extensions.install_origins.enabled", false); pref("extensions.install_origins.enabled", false);
// browser_style deprecation - bug 1827910. // TODO: bug 1830712: remove prefs related to browser_style deprecation.
// TODO bug 1830711: set to false. pref("extensions.browser_style_mv3.supported", false);
// TODO bug 1830712: remove pref.
pref("extensions.browser_style_mv3.supported", true);
// TODO bug 1830712: remove pref.
pref("extensions.browser_style_mv3.same_as_mv2", false); pref("extensions.browser_style_mv3.same_as_mv2", false);
// Middle-mouse handling // Middle-mouse handling

View file

@ -144,14 +144,12 @@ XPCOMUtils.defineLazyPreferenceGetter(
// - false = remove: always use false, even when true is specified. // - false = remove: always use false, even when true is specified.
// (if .same_as_mv2 is set, also warn if the default changed) // (if .same_as_mv2 is set, also warn if the default changed)
// Deprecation plan: https://bugzilla.mozilla.org/show_bug.cgi?id=1827910#c1 // Deprecation plan: https://bugzilla.mozilla.org/show_bug.cgi?id=1827910#c1
// Bug 1830711 will set browser_style_mv3.supported to false.
XPCOMUtils.defineLazyPreferenceGetter( XPCOMUtils.defineLazyPreferenceGetter(
lazy, lazy,
"browserStyleMV3supported", "browserStyleMV3supported",
"extensions.browser_style_mv3.supported", "extensions.browser_style_mv3.supported",
false false
); );
// Bug 1830711 will then set browser_style_mv3.supported to false.
XPCOMUtils.defineLazyPreferenceGetter( XPCOMUtils.defineLazyPreferenceGetter(
lazy, lazy,
"browserStyleMV3sameAsMV2", "browserStyleMV3sameAsMV2",

View file

@ -7,11 +7,6 @@ ExtensionTestUtils.failOnSchemaWarnings(false);
const PREF_SUPPORTED = "extensions.browser_style_mv3.supported"; const PREF_SUPPORTED = "extensions.browser_style_mv3.supported";
const PREF_SAME_AS_MV2 = "extensions.browser_style_mv3.same_as_mv2"; const PREF_SAME_AS_MV2 = "extensions.browser_style_mv3.same_as_mv2";
// Set the prefs to the defaults at the end of the deprecation process.
// TODO bug 1830711: remove these two lines.
Services.prefs.setBoolPref(PREF_SUPPORTED, false);
Services.prefs.setBoolPref(PREF_SAME_AS_MV2, false);
function checkBrowserStyleInManifestKey(extension, key, expected) { function checkBrowserStyleInManifestKey(extension, key, expected) {
let actual = extension.extension.manifest[key].browser_style; let actual = extension.extension.manifest[key].browser_style;
Assert.strictEqual(actual, expected, `Expected browser_style of "${key}"`); Assert.strictEqual(actual, expected, `Expected browser_style of "${key}"`);