[Pkg-mozext-commits] [tabmixplus] 113/123: Load the frame script after registering listeners (regression from changeset b5bf1b1ccc63)
David Prévot
taffit at moszumanska.debian.org
Wed Sep 17 21:16:33 UTC 2014
This is an automated email from the git hooks/post-receive script.
taffit pushed a commit to branch master
in repository tabmixplus.
commit a7fc57c2daaf62f01ead55cd291c0d8066e42240
Author: onemen <tabmix.onemen at gmail.com>
Date: Tue Sep 16 15:09:05 2014 +0300
Load the frame script after registering listeners (regression from changeset b5bf1b1ccc63)
---
chrome/content/tabmix.js | 15 +++++++++++++++
modules/DocShellCapabilities.jsm | 9 +--------
modules/Services.jsm | 2 ++
3 files changed, 18 insertions(+), 8 deletions(-)
diff --git a/chrome/content/tabmix.js b/chrome/content/tabmix.js
index 288fdbf..fc3739d 100644
--- a/chrome/content/tabmix.js
+++ b/chrome/content/tabmix.js
@@ -307,6 +307,15 @@ var TMP_eventListener = {
}
},
+ receiveMessage: function(message) {
+ let browser = message.target;
+ switch (message.name) {
+ case "Tabmix:SetSyncHandler":
+ TabmixSvc.syncHandlers.set(browser.permanentKey, message.objects.syncHandler);
+ break;
+ }
+ },
+
toggleEventListener: function(aObj, aArray, aEnable, aHandler) {
var handler = aHandler || this;
var eventListener = aEnable ? "addEventListener" : "removeEventListener";
@@ -446,6 +455,7 @@ var TMP_eventListener = {
if (Tabmix.isVersion(320)) {
let mm = window.getGroupMessageManager("browsers");
+ mm.addMessageListener("Tabmix:SetSyncHandler", this);
mm.loadFrameScript("chrome://tabmixplus/content/content.js", true);
}
@@ -1050,6 +1060,11 @@ var TMP_eventListener = {
Tabmix.navToolbox.deinit();
if (Tabmix.DocShellCapabilitiesInitialized)
Tabmix.docShellCapabilities.deinit(window);
+
+ if (Tabmix.isVersion(320)) {
+ let mm = window.getGroupMessageManager("browsers");
+ mm.removeMessageListener("Tabmix:SetSyncHandler", this);
+ }
},
// some theme not useing updated Tabmix tab binding
diff --git a/modules/DocShellCapabilities.jsm b/modules/DocShellCapabilities.jsm
index f572d42..df55ccf 100644
--- a/modules/DocShellCapabilities.jsm
+++ b/modules/DocShellCapabilities.jsm
@@ -16,7 +16,6 @@ this.DocShellCapabilities = {
this.useFrameScript = TabmixSvc.version(320);
if (this.useFrameScript) {
let mm = window.getGroupMessageManager("browsers");
- mm.addMessageListener("Tabmix:SetSyncHandler", this);
mm.addMessageListener("Tabmix:restoPermissionsComplete", this);
}
},
@@ -24,19 +23,13 @@ this.DocShellCapabilities = {
deinit: function(window) {
if (this.useFrameScript) {
let mm = window.getGroupMessageManager("browsers");
- mm.removeMessageListener("Tabmix:SetSyncHandler", this);
mm.removeMessageListener("Tabmix:restoPermissionsComplete", this);
}
},
- _syncHandlers: new WeakMap(),
-
receiveMessage: function(message) {
let browser = message.target;
switch (message.name) {
- case "Tabmix:SetSyncHandler":
- this._syncHandlers.set(browser.permanentKey, message.objects.syncHandler);
- break;
case "Tabmix:restoPermissionsComplete":
// Update the persistent tab state cache
TabStateCache.update(browser, {
@@ -57,7 +50,7 @@ this.DocShellCapabilities = {
return this.caps.filter(function(cap) !browser.docShell["allow" + cap]);
try {
- let handler = this._syncHandlers.get(browser.permanentKey);
+ let handler = TabmixSvc.syncHandlers.get(browser.permanentKey);
return handler.getCapabilities();
} catch(ex) { }
return "";
diff --git a/modules/Services.jsm b/modules/Services.jsm
index ec56636..957ec9b 100644
--- a/modules/Services.jsm
+++ b/modules/Services.jsm
@@ -121,6 +121,8 @@ let TabmixSvc = {
}
},
+ syncHandlers: new WeakMap(),
+
windowStartup: {
QueryInterface: XPCOMUtils.generateQI([Ci.nsIObserver,
Ci.nsISupportsWeakReference]),
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-mozext/tabmixplus.git
More information about the Pkg-mozext-commits
mailing list