[Pkg-mozext-commits] [tabmixplus] 17/48: After changeset 5e2312e5dcab ctrl-click and middle-click (when 'middlecurrent' preference is true) on a link opens extra tab with the link
David Prévot
taffit at moszumanska.debian.org
Sun Aug 20 03:14:35 UTC 2017
This is an automated email from the git hooks/post-receive script.
taffit pushed a commit to branch master
in repository tabmixplus.
commit 32803197b519129487e8e8fbc068af739a4310bb
Author: onemen <tabmix.onemen at gmail.com>
Date: Wed Jul 26 18:43:15 2017 +0300
After changeset 5e2312e5dcab ctrl-click and middle-click (when 'middlecurrent' preference is true) on a link opens extra tab with the link
---
chrome/content/scripts/content.js | 9 ++++++++-
1 file changed, 8 insertions(+), 1 deletion(-)
diff --git a/chrome/content/scripts/content.js b/chrome/content/scripts/content.js
index 0e8ba4e..eae81e0 100644
--- a/chrome/content/scripts/content.js
+++ b/chrome/content/scripts/content.js
@@ -8,9 +8,13 @@ var {classes: Cc, interfaces: Ci, utils: Cu} = Components;
Cu.import("resource://gre/modules/XPCOMUtils.jsm", this);
Cu.import("resource://gre/modules/Services.jsm", this);
+XPCOMUtils.defineLazyModuleGetter(this, "AppConstants",
+ "resource://gre/modules/AppConstants.jsm");
+
// DocShellCapabilities exist since Firefox 27
XPCOMUtils.defineLazyModuleGetter(this, "DocShellCapabilities",
"resource:///modules/sessionstore/DocShellCapabilities.jsm");
+
XPCOMUtils.defineLazyModuleGetter(this, "BrowserUtils",
"resource://gre/modules/BrowserUtils.jsm");
@@ -197,7 +201,10 @@ TabmixClickEventHandler = {
if (linkData) {
let [href, node] = linkData;
let currentHref = event.originalTarget.ownerDocument.documentURI;
- if (LinkNodeUtils.isSpecialPage(href, node, currentHref)) {
+ const divertMiddleClick = event.button == 1 && TabmixSvc.prefBranch.getBoolPref("middlecurrent");
+ const ctrlKey = AppConstants.platform == "macosx" ? event.metaKey : event.ctrlKey;
+ if (divertMiddleClick || ctrlKey ||
+ LinkNodeUtils.isSpecialPage(href, node, currentHref)) {
this.contentAreaClick(event, linkData);
}
}
--
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