[Pkg-mozext-commits] [tabmixplus] 54/123: Don't change anything when link clicked with modifiers to save link or to open it in new window

David Prévot taffit at moszumanska.debian.org
Wed Sep 17 21:16:26 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 aba1b8f04fc7ec71bc879f9af5b38b1f91a5b9df
Author: onemen <tabmix.onemen at gmail.com>
Date:   Thu Aug 28 23:18:05 2014 +0300

    Don't change anything when link clicked with modifiers to save link or to open it in new window
---
 chrome/content/links/contentLinks.js |  2 +-
 modules/ContentClick.jsm             | 17 +++++++++++------
 2 files changed, 12 insertions(+), 7 deletions(-)

diff --git a/chrome/content/links/contentLinks.js b/chrome/content/links/contentLinks.js
index f2ca351..c22fc00 100644
--- a/chrome/content/links/contentLinks.js
+++ b/chrome/content/links/contentLinks.js
@@ -12,7 +12,7 @@ Tabmix.contentAreaClick = {
 
     Tabmix.changeCode(window, "contentAreaClick")._replace(
       'if (linkNode &&',
-      'var {where, suppressTabsOnFileDownload, _href, targetAttr} =\n' +
+      'var {where, _href, suppressTabsOnFileDownload, targetAttr} =\n' +
       '      Tabmix.ContentClick.getParamsForLink(event, linkNode, href,\n' +
       '          gBrowser.selectedBrowser, document.commandDispatcher.focusedWindow);\n' +
       '  href = _href;\n\n' +
diff --git a/modules/ContentClick.jsm b/modules/ContentClick.jsm
index fda9d0d..2638809 100644
--- a/modules/ContentClick.jsm
+++ b/modules/ContentClick.jsm
@@ -130,8 +130,13 @@ let ContentClickInternal = {
   },
 
   getParamsForLink: function(event, node, href, browser, focusedWindow, remote) {
+    // don't change anything when whereToOpenLink return save or window
+    let win = browser.ownerDocument.defaultView;
+    if (/^save|window/.test(win.whereToOpenLink(event)))
+      return {where: "default", _href: href};
+
     this._browser = browser;
-    this._window = this._browser.ownerDocument.defaultView;
+    this._window = win;
     this._focusedWindow = focusedWindow;
 
     let targetAttr = this.getTargetAttr(node);
@@ -159,8 +164,8 @@ let ContentClickInternal = {
 
     return {
       where: where,
-      suppressTabsOnFileDownload: suppressTabsOnFileDownload || false,
       _href: href,
+      suppressTabsOnFileDownload: suppressTabsOnFileDownload || false,
       targetAttr: targetAttr
     };
   },
@@ -342,16 +347,16 @@ let ContentClickInternal = {
     if (aEvent.tabmix_isRemote)
       return;
 
-    this._browser = aBrowser;
-    this._window = this._browser.ownerDocument.defaultView;
-    this._focusedWindow = aFocusedWindow;
-
     if (typeof aEvent.tabmix_openLinkWithHistory == "boolean")
       return;
 
     if (aEvent.button != 0 || aEvent.shiftKey || aEvent.ctrlKey || aEvent.altKey || aEvent.metaKey)
       return;
 
+    this._browser = aBrowser;
+    this._window = this._browser.ownerDocument.defaultView;
+    this._focusedWindow = aFocusedWindow;
+
     this.getPref();
     if (!this.currentTabLocked && this.targetPref == 0)
       return;

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