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

Preloading with download attributes trigger twice #76

Open Darklg opened 4 years ago

Darklg commented 4 years ago

Hi !

When the script is enabled a link has a "download" attribute, a click triggers two downloads of this file.

<a href="http://example.com/file.zip" download>my file</a>

I have reproduced it in Chrome macOS 81.0.4044.138, and Firefox macOS 76.0.1.

The browser will sometimes ask to enable download for multiple files ( sorry, alert is in french )

capture

It happened on the WordPress plugin, but it can be reproduced on your demo website by adding a download attribute to most links.

Once the WordPress plugin is disabled, everything works fine, as in a local test file when i removed the script.