diff --git a/instantpage.js b/instantpage.js index 6344e78..fa1ad29 100644 --- a/instantpage.js +++ b/instantpage.js @@ -363,6 +363,12 @@ function isPreloadable(anchorElement) { return } + // If the href only contains "#", browsers will return empty string instead of "#" when checking anchorElement.hash, + // so we have to do an explicit check for it. + if (anchorElement.getAttribute('href') === '#') { + return; + } + if (anchorElement.protocol == 'http:' && location.protocol == 'https:') { return } diff --git a/package-lock.json b/package-lock.json new file mode 100644 index 0000000..ef9a7b8 --- /dev/null +++ b/package-lock.json @@ -0,0 +1,13 @@ +{ + "name": "instant.page", + "version": "5.2.0", + "lockfileVersion": 3, + "requires": true, + "packages": { + "": { + "name": "instant.page", + "version": "5.2.0", + "license": "MIT" + } + } +}