[Pkg-mozext-commits] [tabmixplus] 23/56: Replace eval of gBrowser._blurTab with wrapped function

David Prévot taffit at moszumanska.debian.org
Mon Jun 6 00:02:34 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 3619bcc1ade2fd1b61428848dc37da4c9e451055
Author: onemen <tabmix.onemen at gmail.com>
Date:   Tue May 10 22:32:03 2016 +0300

    Replace eval of gBrowser._blurTab with wrapped function
---
 chrome/content/minit/tablib.js | 32 ++++++++++++++++----------------
 1 file changed, 16 insertions(+), 16 deletions(-)

diff --git a/chrome/content/minit/tablib.js b/chrome/content/minit/tablib.js
index 1fef20c..8abe77b 100644
--- a/chrome/content/minit/tablib.js
+++ b/chrome/content/minit/tablib.js
@@ -263,22 +263,22 @@ var tablib = { // eslint-disable-line
        $&'
     ).toCode();
 
-    Tabmix.changeCode(gBrowser, "gBrowser._blurTab")._replace(
-      'if (aTab.owner &&',
-      'if (false &&'
-    )._replace(
-      'var tab = aTab;',
-      'var tab, newIndex = this.selectIndexAfterRemove(aTab);\
-       if (newIndex > -1) {\
-         let tabs = TMP_TabView.currentGroup();\
-         tab = tabs[newIndex];\
-         if (tab && !tab.closing) {\
-           this.selectedTab = tab;\
-           return;\
-         }\
-       }\
-       tab = aTab;'
-    ).toCode();
+    Tabmix.originalFunctions.gBrowser_blurTab = gBrowser._blurTab;
+    gBrowser._blurTab = function(aTab) {
+      if (!aTab.selected)
+        return;
+
+      let newIndex = this.selectIndexAfterRemove(aTab);
+      if (newIndex > -1) {
+        let tabs = TMP_TabView.currentGroup();
+        let tab = tabs[newIndex];
+        if (tab && !tab.closing) {
+          this.selectedTab = tab;
+          return;
+        }
+      }
+      Tabmix.originalFunctions.gBrowser_blurTab.apply(this, arguments);
+    };
 
     Tabmix.changeCode(gBrowser, "gBrowser.getWindowTitleForBrowser")._replace(
       'if (!docTitle)',

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