[Pkg-mozext-commits] [tabmixplus] 40/73: Update the check for SearchLoad Options extension and Searchload Options Revived (Pale Moon)

David Prévot taffit at moszumanska.debian.org
Mon May 9 02:30:54 UTC 2016


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

taffit pushed a commit to branch master
in repository tabmixplus.

commit a5ee7dcbdd5b3284e1c511f27ac5b04d0381d0bd
Author: onemen <tabmix.onemen at gmail.com>
Date:   Sat Apr 9 12:58:29 2016 +0300

    Update the check for SearchLoad Options extension and Searchload Options Revived (Pale Moon)
---
 chrome/content/minit/minit.js | 14 ++++++++++----
 1 file changed, 10 insertions(+), 4 deletions(-)

diff --git a/chrome/content/minit/minit.js b/chrome/content/minit/minit.js
index 5890128..420052d 100644
--- a/chrome/content/minit/minit.js
+++ b/chrome/content/minit/minit.js
@@ -1254,13 +1254,19 @@ Tabmix.navToolbox = {
       return;
 
     let obj, fn, $LF;
-    let searchLoadExt = "esteban_torres" in window && "searchLoad_Options" in esteban_torres;
-    let _handleSearchCommand = searchLoadExt ? esteban_torres.searchLoad_Options.MOZhandleSearch.toString() :
+    // https://addons.palemoon.org/extensions/search-tools/searchload-options-revived/
+    // searchLoadExt will be null when searchload-options extension is restartless
+    let searchLoadExt = (est => {
+      return est && typeof est.searchLoad_Options == "object" &&
+        est.searchLoad_Options;
+    })(window.esteban_torres || window);
+
+    let _handleSearchCommand = searchLoadExt ? searchLoadExt.MOZhandleSearch.toString() :
                                                searchbar.handleSearchCommand.toString();
     // we check browser.search.openintab also for search button click
     if (_handleSearchCommand.indexOf("whereToOpenLink") > -1 &&
           _handleSearchCommand.indexOf("forceNewTab") == -1) {
-      [obj, fn] = searchLoadExt ? [esteban_torres.searchLoad_Options, "MOZhandleSearch"] :
+      [obj, fn] = searchLoadExt ? [searchLoadExt, "MOZhandleSearch"] :
                                       [searchbar, "handleSearchCommand"];
       $LF = '\n            ';
       Tabmix.changeCode(obj, "searchbar." + fn)._replace(
@@ -1274,7 +1280,7 @@ Tabmix.navToolbox = {
     }
 
     let organizeSE = "organizeSE" in window && "doSearch" in window.organizeSE;
-    [obj, fn] = searchLoadExt ? [esteban_torres.searchLoad_Options, "MOZdoSearch"] :
+    [obj, fn] = searchLoadExt ? [searchLoadExt, "MOZdoSearch"] :
                                     [organizeSE ? window.organizeSE : searchbar, "doSearch"];
     if ("__treestyletab__original_doSearch" in searchbar)
       [obj, fn] = [searchbar, "__treestyletab__original_doSearch"];

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