Bug 1544749 - Sidebar iframe onload callback should not rely on event.target r=daisuke
authorJulian Descottes <jdescottes@mozilla.com>
Thu, 18 Apr 2019 09:05:53 +0000
changeset 470041 f71f9d2fa72baeebe80e0c44e167e35bed04aa59
parent 470040 ad0f4d97dd1efd4bbbe4150f552a701e88aedbbc
child 470042 51423343879f6ea29b96b2c3506cc2fb3fd16e60
push id112839
push userapavel@mozilla.com
push dateThu, 18 Apr 2019 21:50:57 +0000
treeherdermozilla-inbound@e0a826fcd85b [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersdaisuke
bugs1544749
milestone68.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 1544749 - Sidebar iframe onload callback should not rely on event.target r=daisuke Depends on D27675 The target of the iframe load event is the content document when running in frame with type=chrome. When running in frame with type=content, the target will be the iframe element itself. Stop relying on event.target so that the Sidebar can work in both cases Differential Revision: https://phabricator.services.mozilla.com/D27677
devtools/client/framework/sidebar.js
--- a/devtools/client/framework/sidebar.js
+++ b/devtools/client/framework/sidebar.js
@@ -260,18 +260,18 @@ ToolSidebar.prototype = {
     } else {
       this._tabbox.tabs.appendChild(tab);
     }
 
     // Add the tab to the allTabs menu if exists
     const allTabsItem = this._addItemToAllTabsMenu(id, tab, options);
 
     const onIFrameLoaded = (event) => {
-      const doc = event.target;
-      const win = doc.defaultView;
+      const win = iframe.contentWindow;
+      const doc = win.document;
       tab.setAttribute("label", doc.title);
 
       if (allTabsItem) {
         allTabsItem.setAttribute("label", doc.title);
       }
 
       iframe.removeEventListener("load", onIFrameLoaded, true);
       if ("setPanel" in win) {