Bug 1251863 - Browser Console focuses wrong window. r=lclark
authorRicky Chien <ricky060709@gmail.com>
Sun, 27 Mar 2016 00:19:00 +0100
changeset 291292 b932cef38db8ae5957d2b49a4f47f067938a09a0
parent 291291 5174488b2a590ce8c6ba9bed2d8458252af3b282
child 291293 85199a7b852fe6729f5708f56a31e6a368ddc009
push id30131
push userkwierso@gmail.com
push dateFri, 01 Apr 2016 22:43:45 +0000
treeherdermozilla-central@c40c0b2f3b4c [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerslclark
bugs1251863
milestone48.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1251863 - Browser Console focuses wrong window. r=lclark
devtools/client/webconsole/hudservice.js
--- a/devtools/client/webconsole/hudservice.js
+++ b/devtools/client/webconsole/hudservice.js
@@ -584,21 +584,23 @@ WebConsole.prototype = {
       let popupset = this.mainPopupSet;
       let panels = popupset.querySelectorAll("panel[hudId=" + this.hudId + "]");
       for (let panel of panels) {
         panel.hidePopup();
       }
     }
 
     let onDestroy = Task.async(function*() {
-      try {
-        yield this.target.activeTab.focus()
-      }
-      catch (ex) {
-        // Tab focus can fail if the tab or target is closed.
+      if (!this._browserConsole) {
+        try {
+          yield this.target.activeTab.focus();
+        }
+        catch (ex) {
+          // Tab focus can fail if the tab or target is closed.
+        }
       }
 
       let id = WebConsoleUtils.supportsString(this.hudId);
       Services.obs.notifyObservers(id, "web-console-destroyed", null);
       this._destroyer.resolve(null);
     }.bind(this));
 
     if (this.ui) {