instantpage / instant.page

Make your site’s pages instant in 1 minute and improve your conversion rate by 1%
https://instant.page
MIT License
6.01k stars 206 forks source link

Fix empty anchor #129

Open bakura10 opened 3 months ago

bakura10 commented 3 months ago

This fixes the issue https://github.com/instantpage/instant.page/issues/61

To elaborate, browsers seem to have an odd behavior. If a link has a href set to #test, anchorElement.hash will properly return #test. However, if the link is just using #, browsers will return empty string instead of #, which will cause Instant.Page to preload such links, which is causing some pretty annoying side-effects in our situation.

We might may be also check for /#, just to be on the safe side. @dieulot I will let you decide on this :).