Bug 1385630 ensure elements are attached to all windows before onReady, r?Gijs draft
authorShane Caraveo <scaraveo@mozilla.com>
Tue, 22 Aug 2017 16:18:07 -0700
changeset 650849 073811a469db95948062996314edbf99df823fa2
parent 650200 435b18159933ed0e513225618051a548f4d29cb6
child 727511 995940a199ac1aef313a8dd5ddf7ef65fa19789b
push id75511
push usermixedpuppy@gmail.com
push dateTue, 22 Aug 2017 23:18:34 +0000
reviewersGijs
bugs1385630
milestone57.0a1
Bug 1385630 ensure elements are attached to all windows before onReady, r?Gijs MozReview-Commit-ID: Jb0t9FREsTh
browser/components/extensions/ext-sidebarAction.js
--- a/browser/components/extensions/ext-sidebarAction.js
+++ b/browser/components/extensions/ext-sidebarAction.js
@@ -60,16 +60,19 @@ this.sidebarAction = class extends Exten
       icon: IconDetails.normalize({path: options.default_icon}, extension),
       panel: options.default_panel || "",
     };
 
     this.tabContext = new TabContext(tab => Object.create(this.defaults),
                                      extension);
 
     // We need to ensure our elements are available before session restore.
+    for (let window of windowTracker.browserWindows()) {
+      this.createMenuItem(window, this.defaults);
+    }
     this.windowOpenListener = (window) => {
       this.createMenuItem(window, this.defaults);
     };
     windowTracker.addOpenListener(this.windowOpenListener);
 
     this.updateHeader = (event) => {
       let window = event.target.ownerGlobal;
       let details = this.tabContext.get(window.gBrowser.selectedTab);