[Pkg-mozext-commits] [tabmixplus] 23/147: Don't open new tab from links on remote content when role attribute is 'button' or 'menu'
David Prévot
taffit at moszumanska.debian.org
Sat Aug 5 15:27:32 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 867501e4968e6f04cf6b23312f1dc8c162a9260f
Author: onemen <tabmix.onemen at gmail.com>
Date: Mon Oct 31 12:40:58 2016 +0200
Don't open new tab from links on remote content when role attribute is 'button' or 'menu'
---
modules/ContentClick.jsm | 7 +++++++
modules/LinkNodeUtils.jsm | 2 +-
2 files changed, 8 insertions(+), 1 deletion(-)
diff --git a/modules/ContentClick.jsm b/modules/ContentClick.jsm
index e50f576..a0f1655 100644
--- a/modules/ContentClick.jsm
+++ b/modules/ContentClick.jsm
@@ -656,6 +656,13 @@ ContentClickInternal = {
return true;
}
+ if (node.hasAttribute("href") && node.hasAttribute("role")) {
+ const role = node.getAttribute("role");
+ if (role == "button" || role == "menu") {
+ return true;
+ }
+ }
+
// don't interrupt with fastdial links
return "ownerDocument" in node &&
this._window.Tabmix.isNewTabUrls(node.ownerDocument.documentURI);
diff --git a/modules/LinkNodeUtils.jsm b/modules/LinkNodeUtils.jsm
index 3b704fa..8fa2905 100644
--- a/modules/LinkNodeUtils.jsm
+++ b/modules/LinkNodeUtils.jsm
@@ -2,7 +2,7 @@
this.EXPORTED_SYMBOLS = ["LinkNodeUtils"];
-const ATTRIBS = ["onclick", "rel", "onmousedown"];
+const ATTRIBS = ["href", "onclick", "onmousedown", "rel", "role"];
this.LinkNodeUtils = {
isFrameInContent: function(content, href, name) {
--
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