[Pkg-mozext-commits] [tabmixplus] 41/61: Follow up bug 1181475 - Refactor duplicateTabIn to avoid a race between swapping frameloaders and SessionStore

David Prévot taffit at moszumanska.debian.org
Fri Aug 28 19:09:21 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 730b2274b6e54002302219623582990261b93896
Author: onemen <tabmix.onemen at gmail.com>
Date:   Thu Aug 6 23:02:36 2015 +0300

    Follow up bug 1181475 - Refactor duplicateTabIn to avoid a race between swapping frameloaders and SessionStore
---
 chrome/content/minit/tablib.js | 33 ++++++++++++++++++---------------
 1 file changed, 18 insertions(+), 15 deletions(-)

diff --git a/chrome/content/minit/tablib.js b/chrome/content/minit/tablib.js
index 893999e..4cdf586 100644
--- a/chrome/content/minit/tablib.js
+++ b/chrome/content/minit/tablib.js
@@ -549,28 +549,31 @@ var tablib = {
     // we prevent sessionStore.duplicateTab from moving the tab
     Tabmix.changeCode(window, "duplicateTabIn")._replace(
       'switch (where)',
-      '  if (where == "window") {\n' +
-      '    if (Tabmix.getSingleWindowMode())\n' +
-      '      where = "tab";\n' +
+      'if (where == "window" && Tabmix.getSingleWindowMode()) {\n' +
+      '    where = "tab";\n' +
       '  }\n' +
-      '  else {\n' +
-      '    let pref = Tabmix.isCallerInList("gotoHistoryIndex","BrowserForward","BrowserBack") ?\n' +
+      '  $&'
+    )._replace(
+      'gBrowser.selectedTab = newTab;',
+      '// check tabmix preference before selecting the new tab'
+    )._replace(
+      /(\})(\)?)$/,
+      '  if (where != window) {\n' +
+      '    let newTab = gBrowser.getTabForLastPanel();\n' +
+      '    let selectNewTab = where == "tab" ?\n' +
+      '        !Tabmix.prefs.getBoolPref("loadDuplicateInBackground") :\n' +
+      '        Tabmix.prefs.getBoolPref("loadDuplicateInBackground");\n' +
+      '    if (selectNewTab) {\n' +
+      '      gBrowser.selectedTab = newTab;\n' +
+      '    }\n' +
+      '    let pref = Tabmix.isCallerInList("gotoHistoryIndex", "BrowserForward", "BrowserBack") ?\n' +
       '               "openTabNext" : "openDuplicateNext";\n' +
       '    if (Tabmix.prefs.getBoolPref(pref)) {\n' +
       '      let pos = newTab._tPos > aTab._tPos ? 1 : 0;\n' +
       '      gBrowser.moveTabTo(newTab, aTab._tPos + pos);\n' +
       '    }\n' +
       '  }\n' +
-      '  $&'
-    )._replace(
-      'gBrowser.selectedTab = newTab;',
-      'if (!Tabmix.prefs.getBoolPref("loadDuplicateInBackground"))\n' +
-      '        $&'
-    )._replace(
-      'case "tabshifted":',
-      '$&\n' +
-      '      if (Tabmix.prefs.getBoolPref("loadDuplicateInBackground"))\n' +
-      '        gBrowser.selectedTab = newTab;'
+      '$1$2'
     ).toCode();
 
     Tabmix.changeCode(window, "BrowserCloseTabOrWindow")._replace(

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