diff --git a/devtools/client/preferences/devtools-client.js b/devtools/client/preferences/devtools-client.js index f1addb51eb60..660cdb02f139 100644 --- a/devtools/client/preferences/devtools-client.js +++ b/devtools/client/preferences/devtools-client.js @@ -292,8 +292,12 @@ pref("devtools.webconsole.timestampMessages", false); // to automatically trigger multiline editing (equivalent to shift + enter). pref("devtools.webconsole.autoMultiline", true); -// Enable the webconsole sidebar toggle +// Enable the webconsole sidebar toggle in Nightly builds. +#if defined(NIGHTLY_BUILD) +pref("devtools.webconsole.sidebarToggle", true); +#else pref("devtools.webconsole.sidebarToggle", false); +#endif // Disable the new performance recording panel by default pref("devtools.performance.new-panel-enabled", false); diff --git a/devtools/client/webconsole/test/mochitest/browser_console_context_menu_entries.js b/devtools/client/webconsole/test/mochitest/browser_console_context_menu_entries.js index 3672a29ab66f..58c19ba7c30d 100644 --- a/devtools/client/webconsole/test/mochitest/browser_console_context_menu_entries.js +++ b/devtools/client/webconsole/test/mochitest/browser_console_context_menu_entries.js @@ -26,14 +26,14 @@ add_task(async function() { let menuPopup = await openContextMenu(hud, networkMessage.node); ok(menuPopup, "The context menu is displayed on a network message"); - let expectedContextMenu = [ + let expectedContextMenu = addPrefBasedEntries([ "#console-menu-copy-url (a)", "#console-menu-open-url (T)", "#console-menu-store (S) [disabled]", "#console-menu-copy (C)", "#console-menu-copy-object (o) [disabled]", - "#console-menu-select (A)" - ]; + "#console-menu-select (A)", + ]); is(getSimplifiedContextMenu(menuPopup).join("\n"), expectedContextMenu.join("\n"), "The context menu has the expected entries for a network message"); @@ -47,18 +47,26 @@ add_task(async function() { menuPopup = await openContextMenu(hud, logMessage.node); ok(menuPopup, "The context menu is displayed on a log message"); - expectedContextMenu = [ + expectedContextMenu = addPrefBasedEntries([ "#console-menu-store (S) [disabled]", "#console-menu-copy (C)", "#console-menu-copy-object (o) [disabled]", - "#console-menu-select (A)" - ]; + "#console-menu-select (A)", + ]); is(getSimplifiedContextMenu(menuPopup).join("\n"), expectedContextMenu.join("\n"), "The context menu has the expected entries for a simple log message"); await hideContextMenu(hud); }); +function addPrefBasedEntries(expectedEntries) { + if (Services.prefs.getBoolPref("devtools.webconsole.sidebarToggle", false)) { + expectedEntries.push("#console-menu-open-sidebar (V) [disabled]"); + } + + return expectedEntries; +} + function getSimplifiedContextMenu(popupElement) { return [...popupElement.querySelectorAll("menuitem")] .map(entry => {