From 5afe291ae2956dffdcb39b0c4492fd8998a6af4b Mon Sep 17 00:00:00 2001 From: Ciro Date: Sun, 3 Apr 2022 23:52:16 +0200 Subject: [PATCH] fix HTMLAnchorElement download attr behavior --- src/index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/index.js b/src/index.js index e9b126a..1068559 100644 --- a/src/index.js +++ b/src/index.js @@ -50,7 +50,7 @@ export default function Navaid(base, on404) { } function click(e) { - var x = e.target.closest('a'), y = x && x.getAttribute('href'); + var x = e.target.closest('a'), y = x && !x.getAttribute('download') && x.getAttribute('href'); if (e.ctrlKey || e.metaKey || e.altKey || e.shiftKey || e.button || e.defaultPrevented) return; if (!y || x.target || x.host !== location.host || y[0] == '#') return; if (y[0] != '/' || rgx.test(y)) {