diff options
Diffstat (limited to 'browser/components/enterprisepolicies/Policies.sys.mjs')
-rw-r--r-- | browser/components/enterprisepolicies/Policies.sys.mjs | 91 |
1 files changed, 78 insertions, 13 deletions
diff --git a/browser/components/enterprisepolicies/Policies.sys.mjs b/browser/components/enterprisepolicies/Policies.sys.mjs index 41fc89957c..fd15c244cc 100644 --- a/browser/components/enterprisepolicies/Policies.sys.mjs +++ b/browser/components/enterprisepolicies/Policies.sys.mjs @@ -81,23 +81,23 @@ export var Policies = { // Used for cleaning up policies. // Use the same timing that you used for setting up the policy. _cleanup: { - onBeforeAddons(manager) { + onBeforeAddons() { if (Cu.isInAutomation || isXpcshell) { console.log("_cleanup from onBeforeAddons"); clearBlockedAboutPages(); } }, - onProfileAfterChange(manager) { + onProfileAfterChange() { if (Cu.isInAutomation || isXpcshell) { console.log("_cleanup from onProfileAfterChange"); } }, - onBeforeUIStartup(manager) { + onBeforeUIStartup() { if (Cu.isInAutomation || isXpcshell) { console.log("_cleanup from onBeforeUIStartup"); } }, - onAllWindowsRestored(manager) { + onAllWindowsRestored() { if (Cu.isInAutomation || isXpcshell) { console.log("_cleanup from onAllWindowsRestored"); } @@ -112,7 +112,7 @@ export var Policies = { AllowedDomainsForApps: { onBeforeAddons(manager, param) { - Services.obs.addObserver(function (subject, topic, data) { + Services.obs.addObserver(function (subject) { let channel = subject.QueryInterface(Ci.nsIHttpChannel); if (channel.URI.host.endsWith(".google.com")) { channel.setRequestHeader("X-GoogApps-Allowed-Domains", param, true); @@ -540,6 +540,15 @@ export var Policies = { param.DenyUrlRegexList ); } + if ("AgentName" in param) { + setAndLockPref("browser.contentanalysis.agent_name", param.AgentName); + } + if ("ClientSignature" in param) { + setAndLockPref( + "browser.contentanalysis.client_signature", + param.ClientSignature + ); + } let boolPrefs = [ ["IsPerUser", "is_per_user"], ["ShowBlockedResult", "show_blocked_result"], @@ -1802,6 +1811,8 @@ export var Policies = { "places.", "pref.", "print.", + "privacy.userContext.enabled", + "privacy.userContext.ui.enabled", "signon.", "spellchecker.", "toolkit.legacyUserProfileCustomizations.stylesheets", @@ -1981,13 +1992,11 @@ export var Policies = { onBeforeAddons(manager, param) { if (param.Locked) { manager.disallowFeature("changeProxySettings"); - lazy.ProxyPolicies.configureProxySettings(param, setAndLockPref); - } else { - lazy.ProxyPolicies.configureProxySettings( - param, - PoliciesUtils.setDefaultPref - ); } + lazy.ProxyPolicies.configureProxySettings( + param, + PoliciesUtils.setDefaultPref + ); }, }, @@ -2023,6 +2032,13 @@ export var Policies = { setAndLockPref("privacy.clearOnShutdown.sessions", param); setAndLockPref("privacy.clearOnShutdown.siteSettings", param); setAndLockPref("privacy.clearOnShutdown.offlineApps", param); + setAndLockPref( + "privacy.clearOnShutdown_v2.historyFormDataAndDownloads", + param + ); + setAndLockPref("privacy.clearOnShutdown_v2.cookiesAndStorage", param); + setAndLockPref("privacy.clearOnShutdown_v2.cache", param); + setAndLockPref("privacy.clearOnShutdown_v2.siteSettings", param); } else { let locked = true; // Needed to preserve original behavior in perpetuity. @@ -2042,12 +2058,22 @@ export var Policies = { param.Cache, locked ); + PoliciesUtils.setDefaultPref( + "privacy.clearOnShutdown_v2.cache", + param.Cache, + locked + ); } else { PoliciesUtils.setDefaultPref( "privacy.clearOnShutdown.cache", false, lockDefaultPrefs ); + PoliciesUtils.setDefaultPref( + "privacy.clearOnShutdown_v2.cache", + false, + lockDefaultPrefs + ); } if ("Cookies" in param) { PoliciesUtils.setDefaultPref( @@ -2055,12 +2081,26 @@ export var Policies = { param.Cookies, locked ); + + // We set cookiesAndStorage to follow lock and pref + // settings for cookies, and deprecate offlineApps + // and sessions in the new clear on shutdown dialog - Bug 1853996 + PoliciesUtils.setDefaultPref( + "privacy.clearOnShutdown_v2.cookiesAndStorage", + param.Cookies, + locked + ); } else { PoliciesUtils.setDefaultPref( "privacy.clearOnShutdown.cookies", false, lockDefaultPrefs ); + PoliciesUtils.setDefaultPref( + "privacy.clearOnShutdown_v2.cookiesAndStorage", + false, + lockDefaultPrefs + ); } if ("Downloads" in param) { PoliciesUtils.setDefaultPref( @@ -2094,12 +2134,26 @@ export var Policies = { param.History, locked ); + + // We set historyFormDataAndDownloads to follow lock and pref + // settings for history, and deprecate formdata and downloads + // in the new clear on shutdown dialog - Bug 1853996 + PoliciesUtils.setDefaultPref( + "privacy.clearOnShutdown_v2.historyFormDataAndDownloads", + param.History, + locked + ); } else { PoliciesUtils.setDefaultPref( "privacy.clearOnShutdown.history", false, lockDefaultPrefs ); + PoliciesUtils.setDefaultPref( + "privacy.clearOnShutdown_v2.historyFormDataAndDownloads", + false, + lockDefaultPrefs + ); } if ("Sessions" in param) { PoliciesUtils.setDefaultPref( @@ -2120,6 +2174,11 @@ export var Policies = { param.SiteSettings, locked ); + PoliciesUtils.setDefaultPref( + "privacy.clearOnShutdown_v2.siteSettings", + param.SiteSettings, + locked + ); } if ("OfflineApps" in param) { PoliciesUtils.setDefaultPref( @@ -2390,6 +2449,12 @@ export var Policies = { }, }, + TranslateEnabled: { + onBeforeAddons(manager, param) { + setAndLockPref("browser.translations.enable", param); + }, + }, + UserMessaging: { onBeforeAddons(manager, param) { if ("WhatsNew" in param) { @@ -2790,7 +2855,7 @@ function clearBlockedAboutPages() { gBlockedAboutPages = []; } -function blockAboutPage(manager, feature, neededOnContentProcess = false) { +function blockAboutPage(manager, feature) { addChromeURLBlocker(); gBlockedAboutPages.push(feature); @@ -2826,7 +2891,7 @@ let ChromeURLBlockPolicy = { } return Ci.nsIContentPolicy.ACCEPT; }, - shouldProcess(contentLocation, loadInfo) { + shouldProcess() { return Ci.nsIContentPolicy.ACCEPT; }, classDescription: "Policy Engine Content Policy", |