[Pkg-mozext-commits] [tabmixplus] 01/34: Incompatibility with MClickFocusTab extension

David Prévot taffit at moszumanska.debian.org
Mon Jun 27 13:57:55 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 6236c993d9275e624caf3d7bd8e847b3f9eed860
Author: onemen <tabmix.onemen at gmail.com>
Date:   Tue May 24 16:21:54 2016 +0300

    Incompatibility with MClickFocusTab extension
---
 chrome/content/minit/tablib.js | 17 ++++++++++-------
 1 file changed, 10 insertions(+), 7 deletions(-)

diff --git a/chrome/content/minit/tablib.js b/chrome/content/minit/tablib.js
index 3a9a34a..35ccff3 100644
--- a/chrome/content/minit/tablib.js
+++ b/chrome/content/minit/tablib.js
@@ -186,11 +186,14 @@ var tablib = { // eslint-disable-line
         TMP_extensionsCompatibility.treeStyleTab.checkToOpenTabNext(this.selectedTab, checkToOpenTabNext);
       }
 
-      let tab = Tabmix.originalFunctions.gBrowser_addTab.apply(this, args);
+      // we use var here to allow other extensions that wrap our code with
+      // try-catch-finally to have access to 't' outside of the current scope
+      // (see https://addons.mozilla.org/en-US/firefox/addon/mclickfocustab/)
+      var t = Tabmix.originalFunctions.gBrowser_addTab.apply(this, args);
 
       if (isPending || isRestoringTab &&
           Services.prefs.getBoolPref("browser.sessionstore.restore_on_demand")) {
-        tab.setAttribute("tabmix_pending", "true");
+        t.setAttribute("tabmix_pending", "true");
       }
 
       if ((relatedToCurrent === null ? referrerURI : relatedToCurrent) &&
@@ -199,15 +202,15 @@ var tablib = { // eslint-disable-line
         if (this._lastRelatedTab) {
           this._lastRelatedTab.owner = null;
         } else {
-          tab.owner = selectedTab;
+          t.owner = selectedTab;
         }
-        this.moveTabTo(tab, newTabPos);
+        this.moveTabTo(t, newTabPos);
         if (Tabmix.prefs.getBoolPref("openTabNextInverse")) {
-          TMP_LastTab.attachTab(tab, lastRelatedTab);
-          this._lastRelatedTab = tab;
+          TMP_LastTab.attachTab(t, lastRelatedTab);
+          this._lastRelatedTab = t;
         }
       }
-      return tab;
+      return t;
     };
 
     Tabmix.originalFunctions.gBrowser_removeTab = gBrowser.removeTab;

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