[Pkg-mozext-commits] [tabmixplus] 23/47: Change gBrowser.loadOneTab to include dontMove in its params

David Prévot taffit at moszumanska.debian.org
Fri Sep 26 20:57:01 UTC 2014


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

taffit pushed a commit to branch upstream
in repository tabmixplus.

commit eebc764df97a0ba965178c4ffffb508c5a6d3895
Author: onemen <tabmix.onemen at gmail.com>
Date:   Sat Sep 20 13:53:53 2014 +0300

    Change gBrowser.loadOneTab to include dontMove in its params
---
 chrome/content/minit/tablib.js | 36 +++++++++++++++++++++++++++++++-----
 1 file changed, 31 insertions(+), 5 deletions(-)

diff --git a/chrome/content/minit/tablib.js b/chrome/content/minit/tablib.js
index fab1bf6..7524586 100644
--- a/chrome/content/minit/tablib.js
+++ b/chrome/content/minit/tablib.js
@@ -71,11 +71,9 @@ var tablib = {
       let dontMove, isPending, isRestoringTab = Tabmix.callerName() == "ssi_restoreWindow";\n'
     )._replace(
       'params = arguments[1];',
-      '$&\
-       let props = ["referrerURI","charset","postData","ownerTab","allowThirdPartyFixup","fromExternal","relatedToCurrent","skipAnimation"];\
-       props.forEach(function(prop){if (typeof params[prop] == "undefined") params[prop] = null;}); \
-       dontMove = params.dontMove || null;\
-       isPending = params.isPending || null;'
+      'params = tablib.definedParams(arguments[1]);\n' +
+      '              dontMove              = params.dontMove;\n' +
+      '              isPending             = params.isPending;'
     )._replace(
       't.setAttribute("label", aURI);',
       't.setAttribute("label", TabmixTabbar.widthFitTitle && aURI.indexOf("about") != 0 ? this.mStringBundle.getString("tabs.connecting") : aURI);',
@@ -264,6 +262,20 @@ var tablib = {
         'Tabmix.setNumberOfTabsClosedLast();'
       ).toCode();
     }
+
+    Tabmix.changeCode(gBrowser, "gBrowser.loadOneTab")._replace(
+      'var aFromExternal;',
+      '$&\n' +
+      '            var tabmix_dontMove;'
+    )._replace(
+      'params = arguments[1];',
+      'params = tablib.definedParams(arguments[1]);\n' +
+      '              tabmix_dontMove       = params.dontMove;'
+    )._replace(
+      'referrerURI: aReferrerURI,',
+      '$&\n' +
+      '                                  dontMove: tabmix_dontMove,'
+    ).toCode();
   },
 
   change_tabContainer: function change_tabContainer() {
@@ -1601,6 +1613,20 @@ var tablib = {
     gBrowser.renameTab = function(aTab) {Tabmix.renameTab.editTitle(aTab);}
   },
 
+  // prevent 'ReferenceError: reference to undefined property params'
+  // in gBrowser.addTab and gBrowser.loadOneTab
+  props: ["referrerURI","charset","postData","inBackground","ownerTab",
+          "allowThirdPartyFixup","fromExternal","relatedToCurrent",
+          "allowMixedContent","skipAnimation","isUTF8","dontMove","isPending"],
+
+  definedParams: function(params) {
+    this.props.forEach(function(prop){
+      if (typeof params[prop] == "undefined")
+        params[prop] = null;
+    })
+    return params;
+  },
+
   getTabTitle: function TMP_getTabTitle(aTab, url, title) {
     // return the current tab only if it is visible
     if (TabmixTabbar.widthFitTitle &&

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