Annotate permanentKey draft
authorJ. Ryan Stinnett <jryans@gmail.com>
Mon, 25 Apr 2016 19:01:12 -0500
changeset 375853 6ed1b85f50d482b443fffe0b3a2ac2ca608e8722
parent 375852 0102ecc77b008ea25f7a988da897c4a56bbeeb90
child 375854 e83de1952158493db7e7bd7fd6e3704c0e81edd4
push id20402
push userbmo:jryans@gmail.com
push dateMon, 06 Jun 2016 20:31:20 +0000
milestone49.0a1
Annotate permanentKey MozReview-Commit-ID: EyKf5jJ1Aim
browser/base/content/tabbrowser.xml
--- a/browser/base/content/tabbrowser.xml
+++ b/browser/base/content/tabbrowser.xml
@@ -1752,18 +1752,22 @@
           <![CDATA[
             const NS_XUL = "http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul";
 
             let remote = aParams && aParams.remote;
             let uriIsAboutBlank = aParams && aParams.uriIsAboutBlank;
             let isPreloadBrowser = aParams && aParams.isPreloadBrowser;
             let userContextId = aParams && aParams.userContextId;
 
+            window.nextKey = (window.nextKey + 1) || 0;
+
             let b = document.createElementNS(NS_XUL, "browser");
-            b.permanentKey = {};
+            b.permanentKey = {
+              id: window.nextKey
+            };
             b.setAttribute("type", "content-targetable");
             b.setAttribute("message", "true");
             b.setAttribute("messagemanagergroup", "browsers");
             b.setAttribute("contextmenu", this.getAttribute("contentcontextmenu"));
             b.setAttribute("tooltip", this.getAttribute("contenttooltip"));
 
             if (userContextId) {
               b.setAttribute("usercontextid", userContextId);
@@ -4432,17 +4436,21 @@
           }
         ]]></body>
       </method>
 
       <constructor>
         <![CDATA[
           let browserStack = document.getAnonymousElementByAttribute(this, "anonid", "browserStack");
           this.mCurrentBrowser = document.getAnonymousElementByAttribute(this, "anonid", "initialBrowser");
-          this.mCurrentBrowser.permanentKey = {};
+
+          window.nextKey = (window.nextKey + 1) || 0;
+          this.mCurrentBrowser.permanentKey = {
+            id: window.nextKey
+          };
 
           Services.obs.addObserver(this, "live-resize-start", false);
           Services.obs.addObserver(this, "live-resize-end", false);
 
           this.mCurrentTab = this.tabContainer.firstChild;
           const nsIEventListenerService =
             Components.interfaces.nsIEventListenerService;
           let els = Components.classes["@mozilla.org/eventlistenerservice;1"]