# HG changeset patch # User Brian Grinstead # Date 1519077176 28800 # Node ID 56763cbe3a0b3c1d9ae288a00c73d8f5a3de0544 # Parent 1faa0278cbd6b31b959b8e2ba273b4be2e59c68a Bug 1439371 - Close the top window (browserconsole.xul) when the close key shortcut is used in the Browser Console;r=jdescottes In the old frontend `this.window.close` worked since webconsole.xul was used for both the web console and browser console. The new frontend is implemented in HTML (webconsole.html) but for the browser console we wrap that in a XUL document (browserconsole.xul) to support window management and other XUL features. So when the HTML frontend receieves cmd/ctrl+w, we now call the `close` function for the XUL window instead. MozReview-Commit-ID: 5j9rimTC2f8 diff --git a/devtools/client/webconsole/new-webconsole.js b/devtools/client/webconsole/new-webconsole.js --- a/devtools/client/webconsole/new-webconsole.js +++ b/devtools/client/webconsole/new-webconsole.js @@ -245,17 +245,17 @@ NewWebConsoleFrame.prototype = { } else { clearShortcut = l10n.getStr("webconsole.clear.key"); } shortcuts.on(clearShortcut, () => this.jsterm.clearOutput(true)); if (this.isBrowserConsole) { shortcuts.on(l10n.getStr("webconsole.close.key"), - this.window.close.bind(this.window)); + this.window.top.close.bind(this.window.top)); ZoomKeys.register(this.window); } else if (Services.prefs.getBoolPref(PREF_SIDEBAR_ENABLED)) { shortcuts.on("Esc", (name, event) => { if (!this.jsterm.autocompletePopup || !this.jsterm.autocompletePopup.isOpen) { this.newConsoleOutput.dispatchSidebarClose(); } });