Explorar el Código

Fix open in new tab detection with mousedown shortcut

Alexandre Dieulot hace 5 años
padre
commit
6ec0fe047a
Se han modificado 1 ficheros con 4 adiciones y 4 borrados
  1. 4 4
      instantpage.js

+ 4 - 4
instantpage.js

@@ -166,15 +166,15 @@ function mousedownShortcutListener(event) {
 
   const linkElement = event.target.closest('a')
 
+  if (event.which > 1 || event.metaKey || event.ctrlKey) {
+    return
+  }
+
   if (!linkElement) {
     return
   }
 
   linkElement.addEventListener('click', function (event) {
-    if (event.which > 1 || event.metaKey || event.ctrlKey) {
-      return
-    }
-
     if (event.detail == 1337) {
       return
     }