From 6cb185c9735422bafa286ae4faf2f1dcff9d2d19 Mon Sep 17 00:00:00 2001 From: gorhill Date: Tue, 13 Oct 2015 14:04:48 -0400 Subject: this addresses https://www.reddit.com/r/pathofexile/comments/3okptl/ublock_origins_wont_let_me_open_links_in_new_tabs/cvyd5xb --- src/js/contentscript-end.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/js/contentscript-end.js b/src/js/contentscript-end.js index 16d0cbf..7ac8505 100644 --- a/src/js/contentscript-end.js +++ b/src/js/contentscript-end.js @@ -919,11 +919,15 @@ var uBlockCollapser = (function() { return; } var onMouseClick = function(ev) { + var elem = ev.target; + while ( elem !== null && elem.localName !== 'a' ) { + elem = elem.parentElement; + } messager.send({ what: 'mouseClick', x: ev.clientX, y: ev.clientY, - url: ev.target && ev.target.localName === 'a' ? ev.target.href : '' + url: elem !== null ? elem.href : '' }); }; -- cgit v1.1