Bug 1505287: Notify closing event on background tab. r=ochameau,jdescottes
authorDaisuke Akatsuka <dakatsuka@mozilla.com>
Wed, 28 Nov 2018 03:23:41 +0000
changeset 504905 0dd1b93495d527f6a9faa9606e2c1fd295a9eb2f
parent 504904 75d25888cc9186e1f5c0f1dfa613c4c5ad846b43
child 504906 d0ba364e7190bf47cd2f43033824afba026409a9
push id10290
push userffxbld-merge
push dateMon, 03 Dec 2018 16:23:23 +0000
treeherdermozilla-beta@700bed2445e6 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersochameau, jdescottes
bugs1505287
milestone65.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 1505287: Notify closing event on background tab. r=ochameau,jdescottes For now, even when close the background/lazy tabs, could not reflect to `about:debugging` page. In this patch, notify to DevTools clients when close any tabs. Differential Revision: https://phabricator.services.mozilla.com/D12873
devtools/server/actors/webbrowser.js
--- a/devtools/server/actors/webbrowser.js
+++ b/devtools/server/actors/webbrowser.js
@@ -526,17 +526,20 @@ BrowserTabList.prototype.receiveMessage 
     }
   });
 
 /**
  * Implement nsIDOMEventListener.
  */
 BrowserTabList.prototype.handleEvent =
 DevToolsUtils.makeInfallible(function(event) {
-  const browser = event.target.linkedBrowser;
+  // If event target has `linkedBrowser`, the event target can be assumed <tab> element.
+  // Else (in Android case), because event target is assumed <browser> element,
+  // use the target as it is.
+  const browser = event.target.linkedBrowser || event.target;
   switch (event.type) {
     case "TabOpen":
     case "TabSelect": {
       /* Don't create a new actor; iterate will take care of that. Just notify. */
       this._notifyListChanged();
       this._checkListening();
       break;
     }