Commit 1eeb49a1 authored by Kirk Steuber's avatar Kirk Steuber
Browse files

Bug 1429176 - Add enterprise policy to prevent access to about:profiles r=bz,Felipe

MozReview-Commit-ID: G8qPCcn9w1r

--HG--
extra : rebase_source : e28a36b2eae97d052ae9331caac10250e14d557e
extra : intermediate-source : 557ead464afb56d79e80787b3907201af5a3df64
extra : source : 50091c59d620248d5ad25259eb49686940672d64
parent 6b925570
......@@ -37,6 +37,14 @@ this.Policies = {
}
},
"BlockAboutProfiles": {
onBeforeUIStartup(manager, param) {
if (param) {
manager.disallowFeature("about:profiles", true);
}
}
},
"DisableAppUpdate": {
onBeforeAddons(manager, param) {
if (param) {
......
......@@ -10,6 +10,14 @@
"enum": [true]
},
"BlockAboutProfiles": {
"description": "Blocks access to the about:profiles page.",
"first_available": "60.0",
"type": "boolean",
"enum": [true]
},
"DisableAppUpdate": {
"description": "Prevent the browser from updating.",
"first_available": "60.0",
......
......@@ -13,6 +13,7 @@ support-files =
[browser_policies_validate_and_parse_API.js]
[browser_policy_app_update.js]
[browser_policy_block_about_config.js]
[browser_policy_block_about_profiles.js]
[browser_policy_block_set_desktop_background.js]
[browser_policy_default_browser_check.js]
[browser_policy_disable_fxscreenshots.js]
......
/* Any copyright is dedicated to the Public Domain.
* http://creativecommons.org/publicdomain/zero/1.0/ */
"use strict";
add_task(async function setup() {
await setupPolicyEngineWithJson({
"policies": {
"BlockAboutProfiles": true
}
});
});
add_task(async function test_about_profiles() {
let tab = await BrowserTestUtils.openNewForegroundTab(gBrowser, "about:profiles", false);
await ContentTask.spawn(tab.linkedBrowser, null, async function() {
ok(content.document.documentURI.startsWith("about:neterror"),
"about:profiles should display the net error page");
// There is currently a testing-specific race condition that causes this test
// to fail, but it is not a problem if we test after the first page load.
// Until the race condition is fixed, just make sure to test this *after*
// testing the page load.
is(Services.policies.isAllowed("about:profiles"), false,
"Policy Engine should report about:profiles as not allowed");
});
await BrowserTestUtils.removeTab(tab);
});
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment