[Pkg-mozext-commits] [tabmixplus] 05/15: ContentClick.jsm exist in Firefox only from version 38

David Prévot taffit at moszumanska.debian.org
Wed Mar 18 19:05:18 UTC 2015


This is an automated email from the git hooks/post-receive script.

taffit pushed a commit to branch master
in repository tabmixplus.

commit d5f8326c628f3250e5688a14ca92007453fb7569
Author: onemen <tabmix.onemen at gmail.com>
Date:   Sun Mar 8 12:31:16 2015 +0200

    ContentClick.jsm exist in Firefox only from version 38
---
 chrome/content/content.js |  3 ++-
 modules/ContentClick.jsm  | 17 +++++++++--------
 2 files changed, 11 insertions(+), 9 deletions(-)

diff --git a/chrome/content/content.js b/chrome/content/content.js
index ed9b64b..f40b90a 100644
--- a/chrome/content/content.js
+++ b/chrome/content/content.js
@@ -118,7 +118,8 @@ let TabmixContentHandler = {
 
 var TabmixClickEventHandler = {
   init: function init() {
-    global.addEventListener("click", this, true);
+    if (Services.appinfo.processType == Services.appinfo.PROCESS_TYPE_CONTENT)
+      global.addEventListener("click", this, true);
   },
 
   handleEvent: function(event) {
diff --git a/modules/ContentClick.jsm b/modules/ContentClick.jsm
index 2203cbf..7dbe354 100644
--- a/modules/ContentClick.jsm
+++ b/modules/ContentClick.jsm
@@ -12,9 +12,6 @@ XPCOMUtils.defineLazyModuleGetter(this, "PrivateBrowsingUtils",
 XPCOMUtils.defineLazyModuleGetter(this, "Services",
   "resource://gre/modules/Services.jsm");
 
-XPCOMUtils.defineLazyModuleGetter(this, "ContentClick",
-  "resource:///modules/ContentClick.jsm");
-
 XPCOMUtils.defineLazyModuleGetter(this, "LinkNodeUtils",
   "resource://tabmixplus/LinkNodeUtils.jsm");
 
@@ -65,10 +62,18 @@ var ContentClickInternal = {
   _initialized: false,
 
   init: function() {
-    if (!TabmixSvc.version(320) || this._initialized)
+    if (!TabmixSvc.version(380) || this._initialized)
       return;
     this._initialized = true;
 
+    try {
+      Cu.import("resource:///modules/ContentClick.jsm");
+      ContentClick.contentAreaClick.toString();
+    } catch (ex) {
+      this.functions = [];
+      return;
+    }
+
     Tabmix._debugMode = TabmixSvc.debugMode();
     Services.scriptloader.loadSubScript("chrome://tabmixplus/content/changecode.js");
 
@@ -94,10 +99,6 @@ var ContentClickInternal = {
 
   functions: ["contentAreaClick"],
   initContentAreaClick: function TMP_initContentAreaClick() {
-    try {
-      ContentClick.contentAreaClick.toString();
-    } catch (ex) { return; }
-
     this.functions.forEach(function(aFn) {
       ContentClick["tabmix_" + aFn] = ContentClick[aFn];
     });

-- 
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