diff options
author | gorhill <rhill@raymondhill.net> | 2015-10-13 14:04:48 -0400 |
---|---|---|
committer | gorhill <rhill@raymondhill.net> | 2015-10-13 14:04:48 -0400 |
commit | 6cb185c9735422bafa286ae4faf2f1dcff9d2d19 (patch) | |
tree | 70147cd79a19858c5983c8cc054d984b93e84e83 | |
parent | a3ed66688b1d6f9868f0db500eb1e05c2e438545 (diff) | |
download | uBlock-6cb185c9735422bafa286ae4faf2f1dcff9d2d19.zip uBlock-6cb185c9735422bafa286ae4faf2f1dcff9d2d19.tar.gz uBlock-6cb185c9735422bafa286ae4faf2f1dcff9d2d19.tar.bz2 |
this addresses https://www.reddit.com/r/pathofexile/comments/3okptl/ublock_origins_wont_let_me_open_links_in_new_tabs/cvyd5xb
-rw-r--r-- | src/js/contentscript-end.js | 6 |
1 files changed, 5 insertions, 1 deletions
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 : '' }); }; |