[Pkg-mozext-commits] [tabmixplus] 11/147: Update ContentClickInternal.isGreasemonkeyInstalled function, util.js moved to greasemonkey-modules/content/util.js

David Prévot taffit at moszumanska.debian.org
Sat Aug 5 15:27:31 UTC 2017


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

taffit pushed a commit to branch master
in repository tabmixplus.

commit 4275e3d63b17d69e67d9307ae4089dce1d41e970
Author: onemen <tabmix.onemen at gmail.com>
Date:   Sun Oct 30 13:05:37 2016 +0200

    Update ContentClickInternal.isGreasemonkeyInstalled function, util.js moved to greasemonkey-modules/content/util.js
---
 modules/ContentClick.jsm | 19 +++++++------------
 1 file changed, 7 insertions(+), 12 deletions(-)

diff --git a/modules/ContentClick.jsm b/modules/ContentClick.jsm
index c54ef28..d91a280 100644
--- a/modules/ContentClick.jsm
+++ b/modules/ContentClick.jsm
@@ -617,18 +617,13 @@ ContentClickInternal = {
    */
   isGreasemonkeyInstalled: function TMP_isGreasemonkeyInstalled(window) {
     var GM_function;
-    try {
-      // Greasemonkey >= 0.9.10
-      // eslint-disable-next-line tabmix/import-globals
-      Cu.import("resource://greasemonkey/util.js");
-      if (typeof window.GM_util.getEnabled == 'function') {
-        GM_function = window.GM_util.getEnabled;
-      }
-    } catch (e) {
-      // Greasemonkey < 0.9.10
-      if (typeof window.GM_getEnabled == 'function') {
-        GM_function = window.GM_getEnabled;
-      }
+    // Greasemonkey >= 0.9.10
+    if (typeof window.GM_util == "object" &&
+      typeof window.GM_util.getEnabled == 'function') {
+      GM_function = window.GM_util.getEnabled;
+    // Greasemonkey < 0.9.10
+    } else if (typeof window.GM_getEnabled == 'function') {
+      GM_function = window.GM_getEnabled;
     }
 
     if (typeof GM_function != "function")

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