From 64388e2d4c9c251c7a1d4479e82e9eeb794af753 Mon Sep 17 00:00:00 2001 From: Alex Leute Date: Thu, 30 May 2024 13:26:29 -0400 Subject: [PATCH] Only act on press on left click --- index.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/index.js b/index.js index 330c98b..b910a90 100644 --- a/index.js +++ b/index.js @@ -2,7 +2,9 @@ // Act on press const links = document.querySelectorAll("a"); for (const link of links) { - link.addEventListener("mousedown", () => { - window.location = link.href; + link.addEventListener("mousedown", (event) => { + if (event.button == 0) { // Only for left clicks + window.location = link.href; + } }); } \ No newline at end of file