[Pkg-mozext-commits] [tabmixplus] 01/04: Imported Upstream version 0.4.1.6~141114a1

David Prévot taffit at moszumanska.debian.org
Sun Nov 16 22:42:05 UTC 2014


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

taffit pushed a commit to branch master
in repository tabmixplus.

commit d456e47f2e08363a28b18c8183b7af25b51170a8
Author: David Prévot <taffit at debian.org>
Date:   Sun Nov 16 17:36:31 2014 -0400

    Imported Upstream version 0.4.1.6~141114a1
---
 chrome/content/about.js                   |  1 -
 chrome/content/about.xul                  |  1 -
 chrome/content/minit/minit.js             | 13 ++++-
 chrome/content/minit/tablib.js            | 94 ++++++++++++++++++-------------
 chrome/content/preferences/appearance.js  |  7 ---
 chrome/content/preferences/appearance.xul |  3 +-
 chrome/content/preferences/preferences.js |  1 +
 chrome/content/session/session.js         | 23 +++++---
 install.rdf                               |  2 +-
 modules/LinkNodeUtils.jsm                 |  2 +-
 modules/log.jsm                           | 12 ++--
 11 files changed, 95 insertions(+), 64 deletions(-)

diff --git a/chrome/content/about.js b/chrome/content/about.js
index 02c3e59..54a9672 100644
--- a/chrome/content/about.js
+++ b/chrome/content/about.js
@@ -13,7 +13,6 @@ function init() {
   }
   var acceptButton = document.documentElement.getButton("accept");
   acceptButton.label = extensionsStrings.getString("aboutWindowCloseButton");
-  var descriptionString =  document.getElementById("descriptionString");
   var extensionDescription = document.getElementById("extensionDescription");
   extensionDescription.value = addon.description;
 }
diff --git a/chrome/content/about.xul b/chrome/content/about.xul
index 3174770..4126ec8 100644
--- a/chrome/content/about.xul
+++ b/chrome/content/about.xul
@@ -20,7 +20,6 @@
 
   <stringbundleset id="aboutSet">
     <stringbundle id="extensionsStrings" src="chrome://mozapps/locale/extensions/extensions.properties"/>
-    <stringbundle id="descriptionString" src="chrome://tabmixplus/locale/tabmix.properties" />
   </stringbundleset>
 
   <vbox id="clientBox" flex="1">
diff --git a/chrome/content/minit/minit.js b/chrome/content/minit/minit.js
index 61b6485..2e90065 100644
--- a/chrome/content/minit/minit.js
+++ b/chrome/content/minit/minit.js
@@ -1211,8 +1211,13 @@ Tabmix.navToolbox = {
     let organizeSE = "organizeSE" in window && "doSearch" in window.organizeSE;
     let [obj, fn] = searchLoadExt ? [esteban_torres.searchLoad_Options, "MOZdoSearch"] :
                                     [organizeSE ? window.organizeSE : searchbar, "doSearch"];
-    if (obj[fn].toString().indexOf("tabmixArg") > -1)
+    let fnString = obj[fn].toString();
+    if (fnString.indexOf("tabmixArg") > -1)
       return;
+
+    // Personas Interactive Theme Engine 1.6.5
+    let pIte = fnString.indexOf("BTPIServices") > -1;
+
     Tabmix.changeCode(obj, "searchbar." + fn)._replace(
       /(openUILinkIn[^\(]*\([^\)]+)(\))/,
       '$1, null, tabmixArg$2'
@@ -1229,6 +1234,12 @@ Tabmix.navToolbox = {
     )._replace(
       'var loadInBackground = prefs.getBoolPref("loadBookmarksInBackground");',
       'var loadInBackground = Tabmix.prefs.getBoolPref("loadSearchInBackground");', {check: !searchLoadExt && organizeSE}
+    )._replace(
+      /searchbar\.currentEngine/g,
+      'this.currentEngine', {check: pIte}
+    )._replace(
+      /BTPIServices/g,
+      'Services', {check: pIte}
     ).toCode();
   },
 
diff --git a/chrome/content/minit/tablib.js b/chrome/content/minit/tablib.js
index 3c959d9..4f783a1 100644
--- a/chrome/content/minit/tablib.js
+++ b/chrome/content/minit/tablib.js
@@ -14,44 +14,71 @@ var tablib = {
     this.addNewFunctionsTo_gBrowser();
   },
 
+  _loadURIWithFlagsinitialized: false,
   setLoadURIWithFlags: function tablib_setLoadURIWithFlags(aBrowser) {
     // set init value according to lockallTabs state
     // we update this value in TabmixProgressListener.listener.onStateChange
     aBrowser.tabmix_allowLoad = !TabmixTabbar.lockallTabs;
-    Tabmix.changeCode(aBrowser, "browser.loadURIWithFlags")._replace(
-      'if (!aURI)',
-      '  var newURI, allowLoad = this.tabmix_allowLoad != false || aURI.match(/^javascript:/);' +
-      '  try  {' +
-      '    if (!allowLoad) {' +
-      '      newURI = Services.io.newURI(aURI, null, null);' +
-      '      allowLoad = this.currentURI.equalsExceptRef(newURI);' +
-      '    }' +
-      '  } catch (ex) {}'+
-      '  var tabbrowser = document.getBindingParent(this);' +
-      '  var tab = tabbrowser.getTabForBrowser(this);' +
-      '  var isBlankTab = tabbrowser.isBlankNotBusyTab(tab);' +
-      '  var isLockedTab = tab.hasAttribute("locked");' +
-      '  if (!allowLoad && !isBlankTab && isLockedTab) {' +
-      '    var newTab = tabbrowser.addTab();' +
-      '    tabbrowser.selectedTab = newTab;' +
-      '    var browser = newTab.linkedBrowser;' +
-      '    browser.stop();' +
-      '    browser.tabmix_allowLoad = true;' +
-      '    browser.loadURIWithFlags(aURI, aFlags, aReferrerURI, aCharset, aPostData);' +
-      '    return newTab;' +
-      '  }' +
-      '  this.tabmix_allowLoad = aURI == "about:blank" || !isLockedTab;\n' +
-      '  $&'
+
+    // Bug 1075658 - Enable remaining session store tests that are disabled in e10s.
+    // added _loadURIWithFlags to browser.js (Firefox 36+)
+    var obj, name;
+    if (Tabmix.isVersion(360)) {
+      if (this._loadURIWithFlagsinitialized)
+        return;
+      this._loadURIWithFlagsinitialized = true;
+      [obj, name] = [window, "window._loadURIWithFlags"];
+    }
+    else
+      [obj, name] = [aBrowser, "browser.loadURIWithFlags"];
+    Tabmix.changeCode(obj, name)._replace(
+      '{',
+      '$&\n' +
+      '  let args = Array.slice(arguments);\n' +
+      '  if (!Tabmix.isVersion(360))\n' +
+      '    args.unshift(this);\n' +
+      '  var tabmixResult = tablib._loadURIWithFlags.apply(null, args);\n' +
+      '  if (tabmixResult)\n' +
+      '    return tabmixResult;\n'
     )._replace(
       /(\})(\)?)$/,
-      'return null;\
-      $1$2'
+      '  return null;\n' +
+      '$1$2'
     )._replace(
       'this.webNavigation.LOAD_FLAGS_FROM_EXTERNAL',
-      'Ci.nsIWebNavigation.LOAD_FLAGS_FROM_EXTERNAL', {check: "loadTabsProgressively" in window }
+      'Ci.nsIWebNavigation.LOAD_FLAGS_FROM_EXTERNAL',
+      {check: !Tabmix.isVersion(360) && ("loadTabsProgressively" in window)}
     ).toCode();
   },
 
+  _loadURIWithFlags: function(browser, uri, flags, referrer, charset, postdata) {
+    var allowLoad = browser.tabmix_allowLoad != false || uri.match(/^javascript:/);
+    if (!allowLoad) {
+      try {
+        let newURI = Services.io.newURI(uri, null, null);
+        allowLoad = browser.currentURI.equalsExceptRef(newURI);
+      } catch (ex) {}
+    }
+    var tab = gBrowser.getTabForBrowser(browser);
+    var isBlankTab = gBrowser.isBlankNotBusyTab(tab);
+    var isLockedTab = tab.hasAttribute("locked");
+    if (!allowLoad && !isBlankTab && isLockedTab) {
+      let isFlaged = function(flag) !!(flags & Ci.nsIWebNavigation[flag]);
+      let params = {
+        referrerURI: referrer || null,
+        charset: charset  || null,
+        postdata: postdata  || null,
+        inBackground: false,
+        allowThirdPartyFixup: isFlaged("LOAD_FLAGS_ALLOW_THIRD_PARTY_FIXUP"),
+        fromExternal: isFlaged("LOAD_FLAGS_FROM_EXTERNAL"),
+        allowMixedContent: isFlaged("LOAD_FLAGS_ALLOW_MIXED_CONTENT")
+      }
+      return gBrowser.loadOneTab(uri, params);
+    }
+    browser.tabmix_allowLoad = uri == "about:blank" || !isLockedTab;
+    return null;
+  },
+
   change_gBrowser: function change_gBrowser() {
     var obj, fnName;
     if (typeof Fd == "object" && typeof Fd.addTab == "function")
@@ -532,7 +559,8 @@ var tablib = {
       '  let loadflags = #1 ?'.replace("#1", arg) +
       '      Ci.nsIWebNavigation.LOAD_FLAGS_FROM_EXTERNAL :' +
       '      Ci.nsIWebNavigation.LOAD_FLAGS_NONE;' +
-      '  browser.loadURIWithFlags(aURI.spec, loadflags, referrer, null, null);' +
+      '  browser.loadURIWithFlags(aURI.spec, loadflags, referrer, null, null);'
+        .replace("referrer", (Tabmix.isVersion(360) ? "aReferrer" : "referrer")) +
       '  browser.focus();' +
       '}'
     );
@@ -1830,13 +1858,3 @@ Tabmix.getOpenTabNextPref = function TMP_getOpenTabNextPref(aRelatedToCurrent) {
 
   return false;
 }
-
-/*
-Thu Oct 16 2014 09:59:34
-Warning: TypeError: anonymous function does not always return a value
-Source file: chrome://tabmixplus/content/minit/tablib.js
-Line: 913, Column: 6
-Source code:
-      return this.duplicateTab(aTab, url);
-
-*/
diff --git a/chrome/content/preferences/appearance.js b/chrome/content/preferences/appearance.js
index 6b72c86..21927fe 100644
--- a/chrome/content/preferences/appearance.js
+++ b/chrome/content/preferences/appearance.js
@@ -83,13 +83,6 @@ var gAppearancePane = {
       $("alltabsItem").disabled = false;
   },
 
-  setAllTabsItemVisibility: function(aShow) {return;
-    if ($("flexTabs").checked)
-      $("alltabsItem").hidden = !aShow;
-    else
-      $("alltabsItem").hidden = false;
-   },
-
   tabsScrollChanged: function() {
     var multiRow = $("pref_tabsScroll").value == 2;
     $("maxbar").hidden = !multiRow;
diff --git a/chrome/content/preferences/appearance.xul b/chrome/content/preferences/appearance.xul
index bd51fcb..e695434 100644
--- a/chrome/content/preferences/appearance.xul
+++ b/chrome/content/preferences/appearance.xul
@@ -209,8 +209,7 @@
             <hbox id="tabxDependant" class="indent" align="center">
               <menulist id="tabCloseButton" preference="pref_tabCloseButton"
                         style="width: &showTabX.popup.width;" sizetopopup="none" observes="obs_showTabX">
-                <menupopup onpopupshowing="gAppearancePane.setAllTabsItemVisibility(true);"
-                           onpopuphidden="gAppearancePane.setAllTabsItemVisibility(false);">
+                <menupopup>
                   <menuitem value="1" label="&showTabX.always;"/>
                   <menuitem value="5" label="&showTabX.alwaysExeption;" id="alltabsItem"/>
                   <menuitem value="3" label="&showTabX.current;"/>
diff --git a/chrome/content/preferences/preferences.js b/chrome/content/preferences/preferences.js
index 6310e40..d84383b 100644
--- a/chrome/content/preferences/preferences.js
+++ b/chrome/content/preferences/preferences.js
@@ -345,6 +345,7 @@ XPCOMUtils.defineLazyGetter(window, "gPreferenceList", function() {
   "browser.search.context.loadInBackground","browser.search.openintab",
   "browser.sessionstore.interval","browser.sessionstore.max_tabs_undo",
   "browser.sessionstore.postdata","browser.sessionstore.privacy_level",
+  "browser.sessionstore.restore_on_demand",
   "browser.sessionstore.resume_from_crash","browser.startup.page",
   "browser.tabs.animate","browser.tabs.closeWindowWithLastTab",
   "browser.tabs.insertRelatedAfterCurrent","browser.tabs.loadBookmarksInBackground",
diff --git a/chrome/content/session/session.js b/chrome/content/session/session.js
index 1829a5c..ab486b4 100644
--- a/chrome/content/session/session.js
+++ b/chrome/content/session/session.js
@@ -825,7 +825,7 @@ var TabmixSessionManager = {
          var msg = TabmixSvc.getSMString("sm.corrupted.msg0") + "\n"
                   + TabmixSvc.getSMString("sm.corrupted.msg1");
          var buttons = ["", TabmixSvc.setLabel("sm.button.continue")].join("\n");
-         Tabmix.promptService([Tabmix.BUTTON_CANCEL, Tabmix.HIDE_MENUANDTEXT, Tabmix.HIDE_CHECKBOX],
+         this.promptService([Tabmix.BUTTON_CANCEL, Tabmix.HIDE_MENUANDTEXT, Tabmix.HIDE_CHECKBOX],
                [title, msg, "", "", buttons], window, function(){});
          Tabmix.assert(e);
          file.moveTo(this.profileDir, "session.old");
@@ -2091,7 +2091,7 @@ if (container == "error") { Tabmix.log("wrapContainer error path " + path + "\n"
                msg += "\n\n" + TabmixSvc.getSMString("sm.afterCrash.msg1");
                buttons = [TabmixSvc.setLabel("sm.afterCrash.button0"),
                           TabmixSvc.setLabel("sm.afterCrash.button1")].join("\n");
-               Tabmix.promptService([Tabmix.BUTTON_OK, Tabmix.SHOW_MENULIST, Tabmix.HIDE_CHECKBOX, Tabmix.SELECT_CRASH],
+               this.promptService([Tabmix.BUTTON_OK, Tabmix.SHOW_MENULIST, Tabmix.HIDE_CHECKBOX, Tabmix.SELECT_CRASH],
                      [title, msg, "", "", buttons], window, callBack);
             } else {
                msg += " " + TabmixSvc.getSMString("sm.afterCrash.msg2") + ".....";
@@ -2101,7 +2101,7 @@ if (container == "error") { Tabmix.log("wrapContainer error path " + path + "\n"
                   msg += "\n" + TabmixSvc.getSMString("sm.afterCrash.msg4");
                buttons = [TabmixSvc.setLabel("sm.afterCrash.button0.crashed"),
                           TabmixSvc.setLabel("sm.afterCrash.button1")].join("\n");
-               Tabmix.promptService([Tabmix.BUTTON_OK, Tabmix.HIDE_MENUANDTEXT, chkBoxState],
+               this.promptService([Tabmix.BUTTON_OK, Tabmix.HIDE_MENUANDTEXT, chkBoxState],
                      [title, msg, "", chkBoxLabel, buttons], window, callBack);
                this.callBackData.label = this.gSessionPath[3];
             }
@@ -2111,7 +2111,7 @@ if (container == "error") { Tabmix.log("wrapContainer error path " + path + "\n"
                           + TabmixSvc.getSMString("sm.afterCrash.msg1");
                buttons = [TabmixSvc.setLabel("sm.afterCrash.button0"),
                           TabmixSvc.setLabel("sm.afterCrash.button1")].join("\n");
-               Tabmix.promptService([Tabmix.BUTTON_OK, Tabmix.SHOW_MENULIST, Tabmix.HIDE_CHECKBOX, Tabmix.SELECT_DEFAULT],
+               this.promptService([Tabmix.BUTTON_OK, Tabmix.SHOW_MENULIST, Tabmix.HIDE_CHECKBOX, Tabmix.SELECT_DEFAULT],
                      [title, msg, "", "", buttons], window, callBack);
             } else if (closedWinList != 0) {
                msg += " " + TabmixSvc.getSMString("sm.afterCrash.msg6");
@@ -2123,7 +2123,7 @@ if (container == "error") { Tabmix.log("wrapContainer error path " + path + "\n"
                                 + TabmixSvc.getSMString("sm.afterCrash.msg8") + ":";
                buttons = [TabmixSvc.setLabel("sm.afterCrash.button0"),
                           TabmixSvc.setLabel("sm.afterCrash.button1")].join("\n");
-               Tabmix.promptService([Tabmix.BUTTON_OK, Tabmix.SHOW_MENULIST, chkBoxState, Tabmix.SHOW_CLOSED_WINDOW_LIST],
+               this.promptService([Tabmix.BUTTON_OK, Tabmix.SHOW_MENULIST, chkBoxState, Tabmix.SHOW_CLOSED_WINDOW_LIST],
                      [title, msg, "", chkBoxLabel, buttons], window, callBack);
                this.callBackData.whattoLoad = "closedwindow";
             } else {// nothing to restore
@@ -2131,7 +2131,7 @@ if (container == "error") { Tabmix.log("wrapContainer error path " + path + "\n"
                if (!this.enableManager)
                   msg += "\n\n" + TabmixSvc.getSMString("sm.afterCrash.msg3");
                buttons = ["", TabmixSvc.setLabel("sm.button.continue")].join("\n");
-               Tabmix.promptService([Tabmix.BUTTON_CANCEL, Tabmix.HIDE_MENUANDTEXT, chkBoxState],
+               this.promptService([Tabmix.BUTTON_CANCEL, Tabmix.HIDE_MENUANDTEXT, chkBoxState],
                      [title, msg, "", chkBoxLabel, buttons], window, callBack);
             }
          }
@@ -2247,7 +2247,7 @@ if (container == "error") { Tabmix.log("wrapContainer error path " + path + "\n"
                this._sendRestoreCompletedNotifications(true);
             }.bind(this);
             this.waitForCallBack = true;
-            Tabmix.promptService([Tabmix.BUTTON_CANCEL, Tabmix.HIDE_MENUANDTEXT, chkBoxState],
+            this.promptService([Tabmix.BUTTON_CANCEL, Tabmix.HIDE_MENUANDTEXT, chkBoxState],
                            [title, msg, "", chkBoxLabel, buttons], window, callBack);
          }
          this.loadHomePage();
@@ -2306,7 +2306,7 @@ try{
             this.onFirstWindowPromptCallBack(aResult);
          }.bind(this);
          this.waitForCallBack = true;
-         Tabmix.promptService([Tabmix.BUTTON_OK, Tabmix.SHOW_MENULIST, chkBoxState, Tabmix.SELECT_DEFAULT],
+         this.promptService([Tabmix.BUTTON_OK, Tabmix.SHOW_MENULIST, chkBoxState, Tabmix.SELECT_DEFAULT],
                   [title, msg, "", chkBoxLabel, buttons], window, callBack);
 } catch (ex) {Tabmix.assert(ex);}
       }
@@ -2343,6 +2343,13 @@ try{
       this._sendRestoreCompletedNotifications(true);
    },
 
+  // Add delay when calling prompt on startup
+  promptService: function(intParam, strParam, aWindow, aCallBack) {
+    setTimeout(function(){
+      Tabmix.promptService(intParam, strParam, aWindow, aCallBack);
+    }, 0);
+  },
+
  /**
   * user wants to restore only pinned tabs
   * use SessionStore functions to prepare and restore
diff --git a/install.rdf b/install.rdf
index b6bbb40..5244ec1 100644
--- a/install.rdf
+++ b/install.rdf
@@ -5,7 +5,7 @@
   <RDF:Description RDF:about="urn:mozilla:install-manifest"
                    NS1:id="{dc572301-7619-498c-a57d-39143191b318}"
                    NS1:name="Tab Mix Plus"
-                   NS1:version="0.4.1.6pre.141025a1"
+                   NS1:version="0.4.1.6pre.141114a1"
                    NS1:type="2"
                    NS1:multiprocessCompatible="true"
                    NS1:description="Tab browsing with an added boost."
diff --git a/modules/LinkNodeUtils.jsm b/modules/LinkNodeUtils.jsm
index abff011..dd07d49 100644
--- a/modules/LinkNodeUtils.jsm
+++ b/modules/LinkNodeUtils.jsm
@@ -49,7 +49,7 @@ this.LinkNodeUtils = {
           frameElement: !!doc.defaultView.frameElement
         },
         location: {
-          href: doc.location.href
+          href: doc.location ? doc.location.href : ""
         }
       },
       parentNode: {
diff --git a/modules/log.jsm b/modules/log.jsm
index 05b8473..3bdf73f 100644
--- a/modules/log.jsm
+++ b/modules/log.jsm
@@ -82,8 +82,12 @@ let console = {
     } catch (ex) {this.assert(ex, "Error we can't show " + aMethod + " in Tabmix.show");}
   },
 
+  logStringMessage: function(aMessage) {
+    Services.console.logStringMessage(aMessage.replace(/\r\n/g, "\n"));
+  },
+
   clog: function(aMessage) {
-    Services.console.logStringMessage("TabMix :\n" + aMessage);
+    this.logStringMessage("TabMix :\n" + aMessage);
   },
 
   log: function TMP_console_log(aMessage, aShowCaller, offset) {
@@ -91,7 +95,7 @@ let console = {
     let names = this._getNames(aShowCaller ? 2 + offset : 1 + offset);
     let callerName = names[offset+0];
     let callerCallerName = aShowCaller && names[offset+1] ? " (caller was " + names[offset+1] + ")" : "";
-    Services.console.logStringMessage("TabMix " + callerName + callerCallerName + " :\n" + aMessage);
+    this.logStringMessage("TabMix " + callerName + callerCallerName + " :\n" + aMessage);
   },
 
   // get functions names from Error().stack
@@ -273,11 +277,11 @@ options = {
     let location = aError.location ? "\n" + aError.location : "";
     let assertionText = "Tabmix Plus ERROR" + errAt + ":\n" + (aMsg ? aMsg + "\n" : "") + aError.message + location;
     let stackText = "\nStack Trace: \n" + this._formatStack(aError.stack.split("\n"));
-    Services.console.logStringMessage(assertionText + stackText);
+    this.logStringMessage(assertionText + stackText);
   },
 
   trace: function TMP_console_trace(aMsg) {
     let stack = this._formatStack(this._getStackExcludingInternal());
-    Services.console.logStringMessage("Tabmix Trace: " + (aMsg || "") + '\n' + stack);
+    this.logStringMessage("Tabmix Trace: " + (aMsg || "") + '\n' + stack);
   }
 }

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