diff --git a/browser/components/enterprisepolicies/tests/browser/disable_developer_tools/browser_policy_disable_developer_tools.js b/browser/components/enterprisepolicies/tests/browser/disable_developer_tools/browser_policy_disable_developer_tools.js index 02386f08cde9..335a2221f126 100644 --- a/browser/components/enterprisepolicies/tests/browser/disable_developer_tools/browser_policy_disable_developer_tools.js +++ b/browser/components/enterprisepolicies/tests/browser/disable_developer_tools/browser_policy_disable_developer_tools.js @@ -50,6 +50,22 @@ add_task(async function test_updates_post_policy() { "The Web Developer item of the hamburger menu should not be available." ); + let menuButton = document.getElementById("PanelUI-menu-button"); + menuButton.click(); + await BrowserTestUtils.waitForEvent(window.PanelUI.mainView, "ViewShown"); + let moreToolsButtonId = "appMenu-more-button2"; + document.getElementById(moreToolsButtonId).click(); + await BrowserTestUtils.waitForEvent( + document.getElementById("appmenu-moreTools"), + "ViewShown" + ); + is( + document.getElementById("appmenu-developer-tools-view").children.length, + 2, + "The developer tools are properly populated" + ); + window.PanelUI.hide(); + BrowserTestUtils.removeTab(tab); }); diff --git a/devtools/client/framework/devtools-browser.js b/devtools/client/framework/devtools-browser.js index 57843c4ecf18..2a3fec39e431 100644 --- a/devtools/client/framework/devtools-browser.js +++ b/devtools/client/framework/devtools-browser.js @@ -620,7 +620,9 @@ var gDevToolsBrowser = (exports.gDevToolsBrowser = { const menu = win.document.getElementById("menu_devToolbox"); // Hide the "Toggle Tools" menu item if we are on about:devtools-toolbox. - menu.hidden = gDevToolsBrowser._isAboutDevtoolsToolbox(win); + menu.hidden = + gDevToolsBrowser._isAboutDevtoolsToolbox(win) || + Services.prefs.getBoolPref("devtools.policy.disabled", false); // Add a checkmark for the "Toggle Tools" menu item if a toolbox is already opened. const hasToolbox = gDevToolsBrowser.hasToolboxOpened(win);