mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-24 21:31:04 +00:00
Bug 1724284 - Renamed Browser Tools id to browserToolsMenu. r=mhowell,mtigley
Differential Revision: https://phabricator.services.mozilla.com/D125331
This commit is contained in:
parent
081e1015d9
commit
43b771187b
@ -406,7 +406,7 @@
|
||||
hidden="true"
|
||||
oncommand="gSync.openSignInAgainPage('menubar');" data-l10n-id="menu-tools-fxa-re-auth"/>
|
||||
<menuseparator id="devToolsSeparator"/>
|
||||
<menu id="webDeveloperMenu" data-l10n-id="menu-tools-browser-tools">
|
||||
<menu id="browserToolsMenu" data-l10n-id="menu-tools-browser-tools">
|
||||
<menupopup id="menuWebDeveloperPopup">
|
||||
<menuitem id="menu_taskManager"
|
||||
oncommand="switchToTabHavingURI('about:performance', true)"
|
||||
|
@ -9,9 +9,9 @@
|
||||
* It manages all the possible entry points for DevTools:
|
||||
* - Handles command line arguments like -jsconsole,
|
||||
* - Register all key shortcuts,
|
||||
* - Listen for "Web Developer" system menu opening, under "Tools",
|
||||
* - Listen for "Browser Tools" system menu opening, under "Tools",
|
||||
* - Inject the wrench icon in toolbar customization, which is used
|
||||
* by the "Web Developer" list displayed in the hamburger menu,
|
||||
* by the "Browser Tools" list displayed in the hamburger menu,
|
||||
* - Register the JSON Viewer protocol handler.
|
||||
* - Inject the profiler recording button in toolbar customization.
|
||||
*
|
||||
@ -516,7 +516,7 @@ DevToolsStartup.prototype = {
|
||||
// The developer menu hook only needs to be added if devtools have not been
|
||||
// initialized yet.
|
||||
if (!this.initialized) {
|
||||
this.hookWebDeveloperMenu(window);
|
||||
this.hookBrowserToolsMenu(window);
|
||||
}
|
||||
|
||||
this.createDevToolsEnableMenuItem(window);
|
||||
@ -529,13 +529,13 @@ DevToolsStartup.prototype = {
|
||||
* and dragging it from the customization panel to the toolbar.
|
||||
* (i.e. this isn't displayed by default to users!)
|
||||
*
|
||||
* _But_, the "Web Developer" entry in the hamburger menu (the menu with
|
||||
* _But_, the "Browser Tools" entry in the hamburger menu (the menu with
|
||||
* 3 horizontal lines), is using this "developer-button" view to populate
|
||||
* its menu. So we have to register this button for the menu to work.
|
||||
*
|
||||
* Also, this menu duplicates its own entries from the "Web Developer"
|
||||
* Also, this menu duplicates its own entries from the "Browser Tools"
|
||||
* menu in the system menu, under "Tools" main menu item. The system
|
||||
* menu is being hooked by "hookWebDeveloperMenu" which ends up calling
|
||||
* menu is being hooked by "hookBrowserToolsMenu" which ends up calling
|
||||
* devtools/client/framework/browser-menus to create the items for real,
|
||||
* initDevTools, from onViewShowing is also calling browser-menu.
|
||||
*/
|
||||
@ -682,12 +682,12 @@ DevToolsStartup.prototype = {
|
||||
},
|
||||
|
||||
/*
|
||||
* We listen to the "Web Developer" system menu, which is under "Tools" main item.
|
||||
* We listen to the "Browser Tools" system menu, which is under "Tools" main item.
|
||||
* This menu item is hardcoded empty in Firefox UI. We listen for its opening to
|
||||
* populate it lazily. Loading main DevTools module is going to populate it.
|
||||
*/
|
||||
hookWebDeveloperMenu(window) {
|
||||
const menu = window.document.getElementById("webDeveloperMenu");
|
||||
hookBrowserToolsMenu(window) {
|
||||
const menu = window.document.getElementById("browserToolsMenu");
|
||||
const onPopupShowing = () => {
|
||||
if (!Services.prefs.getBoolPref(DEVTOOLS_ENABLED_PREF)) {
|
||||
return;
|
||||
|
@ -110,12 +110,10 @@ add_task(async function() {
|
||||
|
||||
info("Open the menubar Tools menu");
|
||||
const toolsMenuPopup = win.document.getElementById("menu_ToolsPopup");
|
||||
// The "Browser Tools" menu still uses the id `webDeveloperMenu` even though it
|
||||
// is no longer DevTools-specific.
|
||||
const browserToolsMenu = win.document.getElementById("webDeveloperMenu");
|
||||
const browserToolsMenu = win.document.getElementById("browserToolsMenu");
|
||||
ok(
|
||||
!browserToolsMenu.hidden,
|
||||
"The Web Developer item of the tools menu is visible"
|
||||
"The Browser Tools item of the tools menu is visible"
|
||||
);
|
||||
|
||||
await simulateMenuOpen(toolsMenuPopup);
|
||||
|
Loading…
Reference in New Issue
Block a user