Skip to content

Commit

Permalink
Fix the way the href is computed
Browse files Browse the repository at this point in the history
Accessing node.href returns a full URI, meaning we can’t detect '#'
  • Loading branch information
Cimbali committed Apr 11, 2020
1 parent deda5d5 commit 6ad6225
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion addon/inject.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 };
Expand Down

0 comments on commit 6ad6225

Please sign in to comment.