[Pkg-mozext-commits] [tabmixplus] 06/22: Add duckduckgo.com to the list that we catch contentLinkClick events (for non-remote tabs), add miscellaneous tests to whereToOpen function
David Prévot
taffit at moszumanska.debian.org
Sun Jan 4 16:46:35 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 20f45f870888c4de117f70a961c4a1abb2ac41c6
Author: onemen <tabmix.onemen at gmail.com>
Date: Wed Dec 24 21:04:07 2014 +0200
Add duckduckgo.com to the list that we catch contentLinkClick events (for non-remote tabs), add miscellaneous tests to whereToOpen function
---
modules/ContentClick.jsm | 42 +++++++++++++++++++++++++++---------------
modules/LinkNodeUtils.jsm | 1 +
2 files changed, 28 insertions(+), 15 deletions(-)
diff --git a/modules/ContentClick.jsm b/modules/ContentClick.jsm
index fc168cb..1bfbaaa 100644
--- a/modules/ContentClick.jsm
+++ b/modules/ContentClick.jsm
@@ -321,6 +321,9 @@ var ContentClickInternal = {
return [eventWhere + "@2.1"];
}
+ if (this.miscellaneous(wrappedNode))
+ return ["default at 2.2"];
+
/*
* prevents tab form opening when clicking Greasemonkey script
*/
@@ -472,19 +475,8 @@ var ContentClickInternal = {
if (isGmail)
return "6";
- if ("className" in linkNode) {
- // don't interrupt with noscript
- if (linkNode.className.indexOf("__noscriptPlaceholder__") > -1)
- return "7";
-
- // need to find a way to work here only on links
- if (/button/.test(linkNode.className.toLowerCase()))
- return "8";
- }
-
- // don't interrupt with fastdial links
- if ("ownerDocument" in linkNode && this._window.Tabmix.isNewTabUrls(linkNode.ownerDocument.documentURI))
- return "9";
+ if (this.miscellaneous(linkNode))
+ return "7";
if (linkNode.getAttribute("rel") == "sidebar" || this._data.targetAttr == "_search" ||
href.indexOf("mailto:") > -1)
@@ -536,8 +528,9 @@ var ContentClickInternal = {
let blocked;
try {
// for the moment just do it for Google and Yahoo....
- // and tvguide.com - added 2013-07-20
- blocked = /tvguide.com|google|yahoo.com\/search|my.yahoo.com/.test(currentHref);
+ // tvguide.com - added 2013-07-20
+ // duckduckgo.com - added 2014-12-24
+ blocked = /duckduckgo.com|tvguide.com|google|yahoo.com\/search|my.yahoo.com/.test(currentHref);
// youtube.com - added 2013-11-15
if (!blocked && /youtube.com/.test(currentHref) &&
(!this.isGMEnabled() || decodeURI(href).indexOf("return false;") == -1))
@@ -589,6 +582,25 @@ var ContentClickInternal = {
this._GM_function.set(window, GM_function);
},
+ miscellaneous: function(node) {
+ if ("className" in node) {
+ // don't interrupt with noscript
+ if (node.className.indexOf("__noscriptPlaceholder__") > -1)
+ return true;
+
+ // need to find a way to work here only on links
+ if (/button/.test(node.className.toLowerCase()))
+ return true;
+ }
+
+ // don't interrupt with fastdial links
+ if ("ownerDocument" in node &&
+ this._window.Tabmix.isNewTabUrls(node.ownerDocument.documentURI))
+ return true;
+
+ return false;
+ },
+
/**
* @brief Suppress tabs that may be created by installing Greasemonkey script
*
diff --git a/modules/LinkNodeUtils.jsm b/modules/LinkNodeUtils.jsm
index 6727fc7..cb2d13c 100644
--- a/modules/LinkNodeUtils.jsm
+++ b/modules/LinkNodeUtils.jsm
@@ -38,6 +38,7 @@ this.LinkNodeUtils = {
baseURI: node.baseURI,
host: node.host,
pathname: node.pathname,
+ className: node.className,
target: getTargetAttr(node.target, focusedWindow),
ownerDocument: {
__noSuchMethod__: function(id) {
--
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