Bug 1251863 - Browser Console focuses wrong window. r=lclark
authorRicky Chien <ricky060709@gmail.com>
Sun, 27 Mar 2016 00:19:00 +0100
changeset 291351 b932cef38db8ae5957d2b49a4f47f067938a09a0
parent 291350 5174488b2a590ce8c6ba9bed2d8458252af3b282
child 291352 85199a7b852fe6729f5708f56a31e6a368ddc009
push id19656
push usergwagner@mozilla.com
push dateMon, 04 Apr 2016 13:43:23 +0000
treeherderb2g-inbound@e99061fde28a [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerslclark
bugs1251863
milestone48.0a1
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) {