Loading browser/base/content/utilityOverlay.js +4 −0 Original line number Diff line number Diff line Loading @@ -1057,6 +1057,10 @@ function buildHelpMenu() { "helpSafeMode" ).disabled = !Services.policies.isAllowed("safeMode"); document.getElementById( "troubleShooting" ).disabled = !Services.policies.isAllowed("aboutSupport"); let supportMenu = Services.policies.getSupportMenu(); if (supportMenu) { let menuitem = document.getElementById("helpPolicySupport"); Loading browser/components/enterprisepolicies/Policies.jsm +1 −0 Original line number Diff line number Diff line Loading @@ -365,6 +365,7 @@ var Policies = { onBeforeUIStartup(manager, param) { if (param) { blockAboutPage(manager, "about:support"); manager.disallowFeature("aboutSupport"); } }, }, Loading browser/components/enterprisepolicies/tests/browser/browser.ini +1 −0 Original line number Diff line number Diff line Loading @@ -22,6 +22,7 @@ skip-if = os != 'mac' [browser_policy_app_auto_update.js] [browser_policy_app_update.js] [browser_policy_block_about.js] [browser_policy_block_about_support.js] [browser_policy_block_set_desktop_background.js] [browser_policy_bookmarks.js] [browser_policy_cookie_settings.js] Loading browser/components/enterprisepolicies/tests/browser/browser_policy_block_about_support.js 0 → 100644 +41 −0 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_setup(async function() { await setupPolicyEngineWithJson({ policies: { BlockAboutSupport: true, }, }); }); add_task(async function test_help_menu() { buildHelpMenu(); let troubleshootingInfoMenu = document.getElementById("troubleShooting"); is( troubleshootingInfoMenu.getAttribute("disabled"), "true", "The `More Troubleshooting Information` item should be disabled" ); }); add_task(async function test_about_memory() { let tab = await BrowserTestUtils.openNewForegroundTab( gBrowser, "about:memory" ); await SpecialPowers.spawn(tab.linkedBrowser, [], async function() { let aboutSupportLink = content.document.querySelector( "a[href='about:support']" ); Assert.ok( !aboutSupportLink, "The link to about:support at the bottom of the page should not exist" ); }); await BrowserTestUtils.removeTab(tab); }); toolkit/components/aboutmemory/content/aboutMemory.js +9 −7 Original line number Diff line number Diff line Loading @@ -463,6 +463,7 @@ window.onload = function() { gFooter = appendElement(document.body, "div", "ancillary hidden"); if (Services.policies.isAllowed("aboutSupport")) { let a = appendElementWithText( gFooter, "a", Loading @@ -470,6 +471,7 @@ window.onload = function() { "Troubleshooting information" ); a.href = "about:support"; } let legendText1 = "Click on a non-leaf node in a tree to expand ('++') " + Loading Loading
browser/base/content/utilityOverlay.js +4 −0 Original line number Diff line number Diff line Loading @@ -1057,6 +1057,10 @@ function buildHelpMenu() { "helpSafeMode" ).disabled = !Services.policies.isAllowed("safeMode"); document.getElementById( "troubleShooting" ).disabled = !Services.policies.isAllowed("aboutSupport"); let supportMenu = Services.policies.getSupportMenu(); if (supportMenu) { let menuitem = document.getElementById("helpPolicySupport"); Loading
browser/components/enterprisepolicies/Policies.jsm +1 −0 Original line number Diff line number Diff line Loading @@ -365,6 +365,7 @@ var Policies = { onBeforeUIStartup(manager, param) { if (param) { blockAboutPage(manager, "about:support"); manager.disallowFeature("aboutSupport"); } }, }, Loading
browser/components/enterprisepolicies/tests/browser/browser.ini +1 −0 Original line number Diff line number Diff line Loading @@ -22,6 +22,7 @@ skip-if = os != 'mac' [browser_policy_app_auto_update.js] [browser_policy_app_update.js] [browser_policy_block_about.js] [browser_policy_block_about_support.js] [browser_policy_block_set_desktop_background.js] [browser_policy_bookmarks.js] [browser_policy_cookie_settings.js] Loading
browser/components/enterprisepolicies/tests/browser/browser_policy_block_about_support.js 0 → 100644 +41 −0 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_setup(async function() { await setupPolicyEngineWithJson({ policies: { BlockAboutSupport: true, }, }); }); add_task(async function test_help_menu() { buildHelpMenu(); let troubleshootingInfoMenu = document.getElementById("troubleShooting"); is( troubleshootingInfoMenu.getAttribute("disabled"), "true", "The `More Troubleshooting Information` item should be disabled" ); }); add_task(async function test_about_memory() { let tab = await BrowserTestUtils.openNewForegroundTab( gBrowser, "about:memory" ); await SpecialPowers.spawn(tab.linkedBrowser, [], async function() { let aboutSupportLink = content.document.querySelector( "a[href='about:support']" ); Assert.ok( !aboutSupportLink, "The link to about:support at the bottom of the page should not exist" ); }); await BrowserTestUtils.removeTab(tab); });
toolkit/components/aboutmemory/content/aboutMemory.js +9 −7 Original line number Diff line number Diff line Loading @@ -463,6 +463,7 @@ window.onload = function() { gFooter = appendElement(document.body, "div", "ancillary hidden"); if (Services.policies.isAllowed("aboutSupport")) { let a = appendElementWithText( gFooter, "a", Loading @@ -470,6 +471,7 @@ window.onload = function() { "Troubleshooting information" ); a.href = "about:support"; } let legendText1 = "Click on a non-leaf node in a tree to expand ('++') " + Loading