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
--- 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();
}
});