From 6ad622510bab73d906835b242bb1754d00bf391f Mon Sep 17 00:00:00 2001 From: Cimbali Date: Thu, 9 Apr 2020 14:19:22 +0200 Subject: [PATCH] Fix the way the href is computed MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Accessing node.href returns a full URI, meaning we can’t detect '#' --- addon/inject.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addon/inject.js b/addon/inject.js index 05dc0f8..4823d0f 100644 --- a/addon/inject.js +++ b/addon/inject.js @@ -72,7 +72,7 @@ function find_click_target(node) { const href = node.getAttribute('href'); // only return the href if it’s not an obvious NOP - if (href === '#' || href.match(/^javascript:(void\(0?\)|\/\/)?$/)) + if (href === '#' || href.match(/^javascript:(void\(0?\)|\/\/)?;?$/)) return { node } else return { node, href };