Commit eaa95653 authored by Kirk Steuber's avatar Kirk Steuber
Browse files

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

MozReview-Commit-ID: A9hDbOOalng

--HG--
extra : rebase_source : f09e4b3f2208897cc16e62f91c2c3c20d2781248
extra : intermediate-source : 4449476847469890e18a6f0b5d9ac3b1b2ebb612
extra : source : b7e9934e296d25d7fed96f8bc4c21a3599989d6e
parent 1eeb49a1
......@@ -45,6 +45,14 @@ this.Policies = {
}
},
"BlockAboutSupport": {
onBeforeUIStartup(manager, param) {
if (param) {
manager.disallowFeature("about:support", true);
}
}
},
"DisableAppUpdate": {
onBeforeAddons(manager, param) {
if (param) {
......
......@@ -18,6 +18,14 @@
"enum": [true]
},
"BlockAboutSupport": {
"description": "Blocks access to the about:support page.",
"first_available": "60.0",
"type": "boolean",
"enum": [true]
},
"DisableAppUpdate": {
"description": "Prevent the browser from updating.",
"first_available": "60.0",
......
......@@ -14,6 +14,7 @@ support-files =
[browser_policy_app_update.js]
[browser_policy_block_about_config.js]
[browser_policy_block_about_profiles.js]
[browser_policy_block_about_support.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": {
"BlockAboutSupport": true
}
});
});
add_task(async function test_about_support() {
let tab = await BrowserTestUtils.openNewForegroundTab(gBrowser, "about:support", false);
await ContentTask.spawn(tab.linkedBrowser, null, async function() {
ok(content.document.documentURI.startsWith("about:neterror"),
"about:support 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:support"), false,
"Policy Engine should report about:support 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