Fix right mouse click on <a href> in firefox (#1010)

* Check if the left mouse is pressed

* using button instead of which
This commit is contained in:
Stefan Nikolei 2018-06-25 13:11:15 +02:00 committed by Steve Sanderson
parent 14013f5098
commit 61d6d71e8c
1 changed files with 1 additions and 1 deletions

View File

@ -22,7 +22,7 @@ registerFunction(`${registeredFunctionPrefix}.enableNavigationInterception`, ()
// We must explicitly check if it has an 'href' attribute, because if it doesn't, the result might be null or an empty string depending on the browser
const anchorTarget = findClosestAncestor(event.target as Element | null, 'A') as HTMLAnchorElement;
const hrefAttributeName = 'href';
if (anchorTarget && anchorTarget.hasAttribute(hrefAttributeName)) {
if (anchorTarget && anchorTarget.hasAttribute(hrefAttributeName) && event.button === 0) {
const href = anchorTarget.getAttribute(hrefAttributeName)!;
const absoluteHref = toAbsoluteUri(href);