diff --git a/patches/gecko-ironfox-settings-support-extension-blocklist.patch b/patches/gecko-ironfox-settings-support-extension-blocklist.patch new file mode 100644 index 00000000..60143c6f --- /dev/null +++ b/patches/gecko-ironfox-settings-support-extension-blocklist.patch @@ -0,0 +1,17 @@ +diff --git a/toolkit/components/enterprisepolicies/EnterprisePoliciesParent.sys.mjs b/toolkit/components/enterprisepolicies/EnterprisePoliciesParent.sys.mjs +index d7f1cafba23a..f39858ebfe4b 100644 +--- a/toolkit/components/enterprisepolicies/EnterprisePoliciesParent.sys.mjs ++++ b/toolkit/components/enterprisepolicies/EnterprisePoliciesParent.sys.mjs +@@ -446,7 +446,11 @@ EnterprisePoliciesManager.prototype = { + if ("installation_mode" in ExtensionSettings[addon.id]) { + switch (ExtensionSettings[addon.id].installation_mode) { + case "blocked": +- return false; ++ if (Services.prefs.getBoolPref("browser.ironfox.extensions.blocklist.enabled") === true) { ++ return false; ++ } else { ++ return true; ++ }; + default: + return true; + } diff --git a/patches/gecko-ironfox-settings-support-xpinstall.patch b/patches/gecko-ironfox-settings-support-xpinstall.patch index 1775c97a..d701afa6 100644 --- a/patches/gecko-ironfox-settings-support-xpinstall.patch +++ b/patches/gecko-ironfox-settings-support-xpinstall.patch @@ -14,23 +14,19 @@ index afd6d7b6fb49..8021693bdb12 100644 setAndLockPref( "browser.newtabpage.activity-stream.asrouter.userprefs.cfr.addons", diff --git a/toolkit/components/enterprisepolicies/EnterprisePoliciesParent.sys.mjs b/toolkit/components/enterprisepolicies/EnterprisePoliciesParent.sys.mjs -index bb451a279599..1caad93eaed5 100644 +index d7f1cafba23a..a8b7cd405b29 100644 --- a/toolkit/components/enterprisepolicies/EnterprisePoliciesParent.sys.mjs +++ b/toolkit/components/enterprisepolicies/EnterprisePoliciesParent.sys.mjs -@@ -415,11 +415,14 @@ EnterprisePoliciesManager.prototype = { +@@ -439,6 +439,12 @@ EnterprisePoliciesManager.prototype = { mayInstallAddon(addon) { // See https://dev.chromium.org/administrators/policy-list-3/extension-settings-full -- if (!ExtensionSettings) { + if (!Services.prefs.getBoolPref("browser.ironfox.onboardingCompleted") && addon.id === "uBlock0@raymondhill.net" && addon.type === "extension" && addon.isWebExtension && addon.sourceURI === "https://addons.mozilla.org/firefox/downloads/latest/uBlock0@raymondhill.net/latest.xpi" && addon.name === "uBlock Origin" && addon.isCorrectlySigned && addon.providesUpdatesSecurely && addon.isCompatible && addon.isPlatformCompatible && addon.blocklistState === 0) { - return true; - } ++ return true; ++ } + if (!addon.inDatabase && !Services.prefs.getBoolPref("browser.ironfox.xpinstall.enabled")) { + return false; + } - if (addon.id in ExtensionSettings) { -- if ("installation_mode" in ExtensionSettings[addon.id]) { -+ if ("installation_mode" in ExtensionSettings[addon.id] && Services.prefs.getBoolPref("browser.ironfox.extensions.blocklist.enabled")) { - switch (ExtensionSettings[addon.id].installation_mode) { - case "blocked": - return false; + if (!ExtensionSettings) { + return true; + } diff --git a/scripts/patches.yaml b/scripts/patches.yaml index 16bbd1c8..25749681 100644 --- a/scripts/patches.yaml +++ b/scripts/patches.yaml @@ -914,6 +914,13 @@ patches: effect: "Users can maximize privacy and security by disabling WebGL, without compromising usability, by allowing it to be re-enabled on a per-site basis." category: "User Interface" + - file: "gecko-ironfox-settings-support-extension-blocklist.patch" + name: "IronFox Settings Support (Gecko) - Extension Blocklist" + description: "Adds a preference to enable/disable Phoenix's blocklist of malicious/unwanted/sketchy extensions." + reason: "To allow users to benefit from this protection, while being able to disable the blocklist if unwanted (at their own risk)." + effect: "Users can disable the extension blocklist if desired." + category: "User Interface" + - file: "gecko-ironfox-settings-support-xpinstall.patch" name: "IronFox Settings Support (Gecko) - XPInstall" description: "Provides support for a UI toggle to enable/disable the installation of add-ons."