Loading browser/components/enterprisepolicies/Policies.sys.mjs +28 −3 Changes for browser/components/enterprisepolicies/Policies.sys.mjs: 28 added lines, 3 removed lines. Original line number Diff line number Diff line Loading @@ -1185,7 +1185,35 @@ export var Policies = { }, EnableTrackingProtection: { onAllWindowsRestored(manager, param) { if (param.Category) { // browser.contentblocking.category only works as a default pref if // it is locked. PoliciesUtils.setDefaultPref( "browser.contentblocking.category", param.Category, true ); let { ContentBlockingPrefs } = ChromeUtils.importESModule( "moz-src:///browser/components/protections/ContentBlockingPrefs.sys.mjs" ); // These are always locked because they would reset at // startup anyway. ContentBlockingPrefs.setPrefsToCategory( param.Category, true // locked ); ContentBlockingPrefs.matchCBCategory(); } }, onBeforeUIStartup(manager, param) { if ("Exceptions" in param) { addAllowDenyPermissions("trackingprotection", param.Exceptions); } if (param.Category) { // If a category is set, we ignore everything except exceptions. return; } if (param.Value) { PoliciesUtils.setDefaultPref( "privacy.trackingprotection.enabled", Loading Loading @@ -1227,9 +1255,6 @@ export var Policies = { param.Locked ); } if ("Exceptions" in param) { addAllowDenyPermissions("trackingprotection", param.Exceptions); } }, }, Loading browser/components/enterprisepolicies/schemas/policies-schema.json +4 −0 Changes for browser/components/enterprisepolicies/schemas/policies-schema.json: 4 added lines, 0 removed lines. Original line number Diff line number Diff line Loading @@ -638,6 +638,10 @@ "items": { "type": "origin" } }, "Category": { "type": "string", "enum": ["standard", "strict"] } } }, Loading browser/components/enterprisepolicies/tests/browser/trackingprotection/browser.toml 0 → 100644 +5 −0 Changes for browser/components/enterprisepolicies/tests/browser/trackingprotection/browser.toml: 5 added lines, 0 removed lines. Original line number Diff line number Diff line [DEFAULT] prefs = ["browser.policies.alternatePath='<test-root>/browser/components/enterprisepolicies/tests/browser/trackingprotection/trackingprotection.json'"] support-files = ["trackingprotection.json"] ["browser_policy_trackingprotection.js"] browser/components/enterprisepolicies/tests/browser/trackingprotection/browser_policy_trackingprotection.js 0 → 100644 +15 −0 Changes for browser/components/enterprisepolicies/tests/browser/trackingprotection/browser_policy_trackingprotection.js: 15 added lines, 0 removed lines. Original line number Diff line number Diff line /* Any copyright is dedicated to the Public Domain. * http://creativecommons.org/publicdomain/zero/1.0/ */ "use strict"; add_task(async function test_enabletrackingprotection_strict() { await BrowserTestUtils.withNewTab( "about:preferences#privacy", async browser => { let strictRadio = browser.contentDocument.getElementById("strictRadio"); is(strictRadio.selected, true, "Strict checkbox should be selected"); is(strictRadio.disabled, true, "Strict checkbox should be disabled"); } ); }); browser/components/enterprisepolicies/tests/browser/trackingprotection/trackingprotection.json 0 → 100644 +7 −0 Changes for browser/components/enterprisepolicies/tests/browser/trackingprotection/trackingprotection.json: 7 added lines, 0 removed lines. Original line number Diff line number Diff line { "policies": { "EnableTrackingProtection": { "Category": "strict" } } } Loading
browser/components/enterprisepolicies/Policies.sys.mjs +28 −3 Changes for browser/components/enterprisepolicies/Policies.sys.mjs: 28 added lines, 3 removed lines. Original line number Diff line number Diff line Loading @@ -1185,7 +1185,35 @@ export var Policies = { }, EnableTrackingProtection: { onAllWindowsRestored(manager, param) { if (param.Category) { // browser.contentblocking.category only works as a default pref if // it is locked. PoliciesUtils.setDefaultPref( "browser.contentblocking.category", param.Category, true ); let { ContentBlockingPrefs } = ChromeUtils.importESModule( "moz-src:///browser/components/protections/ContentBlockingPrefs.sys.mjs" ); // These are always locked because they would reset at // startup anyway. ContentBlockingPrefs.setPrefsToCategory( param.Category, true // locked ); ContentBlockingPrefs.matchCBCategory(); } }, onBeforeUIStartup(manager, param) { if ("Exceptions" in param) { addAllowDenyPermissions("trackingprotection", param.Exceptions); } if (param.Category) { // If a category is set, we ignore everything except exceptions. return; } if (param.Value) { PoliciesUtils.setDefaultPref( "privacy.trackingprotection.enabled", Loading Loading @@ -1227,9 +1255,6 @@ export var Policies = { param.Locked ); } if ("Exceptions" in param) { addAllowDenyPermissions("trackingprotection", param.Exceptions); } }, }, Loading
browser/components/enterprisepolicies/schemas/policies-schema.json +4 −0 Changes for browser/components/enterprisepolicies/schemas/policies-schema.json: 4 added lines, 0 removed lines. Original line number Diff line number Diff line Loading @@ -638,6 +638,10 @@ "items": { "type": "origin" } }, "Category": { "type": "string", "enum": ["standard", "strict"] } } }, Loading
browser/components/enterprisepolicies/tests/browser/trackingprotection/browser.toml 0 → 100644 +5 −0 Changes for browser/components/enterprisepolicies/tests/browser/trackingprotection/browser.toml: 5 added lines, 0 removed lines. Original line number Diff line number Diff line [DEFAULT] prefs = ["browser.policies.alternatePath='<test-root>/browser/components/enterprisepolicies/tests/browser/trackingprotection/trackingprotection.json'"] support-files = ["trackingprotection.json"] ["browser_policy_trackingprotection.js"]
browser/components/enterprisepolicies/tests/browser/trackingprotection/browser_policy_trackingprotection.js 0 → 100644 +15 −0 Changes for browser/components/enterprisepolicies/tests/browser/trackingprotection/browser_policy_trackingprotection.js: 15 added lines, 0 removed lines. Original line number Diff line number Diff line /* Any copyright is dedicated to the Public Domain. * http://creativecommons.org/publicdomain/zero/1.0/ */ "use strict"; add_task(async function test_enabletrackingprotection_strict() { await BrowserTestUtils.withNewTab( "about:preferences#privacy", async browser => { let strictRadio = browser.contentDocument.getElementById("strictRadio"); is(strictRadio.selected, true, "Strict checkbox should be selected"); is(strictRadio.disabled, true, "Strict checkbox should be disabled"); } ); });
browser/components/enterprisepolicies/tests/browser/trackingprotection/trackingprotection.json 0 → 100644 +7 −0 Changes for browser/components/enterprisepolicies/tests/browser/trackingprotection/trackingprotection.json: 7 added lines, 0 removed lines. Original line number Diff line number Diff line { "policies": { "EnableTrackingProtection": { "Category": "strict" } } }