instant.page

Changelog

5.2.0

- Disable unused preloading on Shopify sites in Chromium < 110. Preloads in Chromium < 110 were unused due to Shopify sending a Vary: Accept header that confused Chromium < 110.
- Add the data-instant-vary-accept option to disable preloading on Chromium < 110 for sites sending a Vary: Accept header. (Shopify sites are automatically opted-in and don’t need to specify it.)
- Preload with high priority (fetchPriority=high) on mouse/touch interactions.
- Fix cross-origin preloading in Chromium (using the non-standard as=document, which might eventually disappear from Chromium).
- Disable (non-working) cross-origin on non-Chromium browsers.
- Comments in the source code now cover almost everything I know about prefetch and instant.page’s logic.

5.1.1

- Fix the error “event.target.closest is not a function” that would sometimes trigger in the mouseover event

5.1.0

- Make triggering clicks on mousedown opt-in.

5.0.1

- Fix the detection of opening a new tab when triggering the click on mousedown.

5.0.0

Announcement.

- Triggers the click on mousedown.
- Fix a bug in Firefox for Android that was making the script error out.

3.0.0

Announcement.

- Option to preload every visible links.
- Doesn’t preload links already preloaded.
- Allow it to run on 2G/data saver.
- Links that you stop touching or hovering over don’t have their preloading request aborted anymore.

2.0.1

- The script is now minified.

2.0.0

Announcement.

- Option to preload on mousedown.
- Option to set a custom delay before preloading on hover.

1.3.0 & 1.3.1

- Whitelist mode.
- Easier to use test suite (options are in the page itself rather than being undocumented command line parameters).

1.2.2

- Don’t preload when data saver is enabled.

1.2.1

- Fix HTTP links not being preloaded.

1.2.0

- Preload external urls if a data-instant-allow-external-links attribute is present in the <body>, or with a data-instant attribute on the <a> element.
- Only preload HTTPS links, and HTTP if not on HTTPS.

1.1.1

- Fix an error on <a> elements without a href attribute.

1.1.0

- Add ability to whitelist a link with a data-instant attribute.

1.0.0

Initial release.

Put this HTML code just before </body>:
<script src="//instant.page/5.2.0" type="module" integrity="sha384-jnZyxPjiipYXnSU0ygqeac2q7CVYMbh84q0uHVRRxEtvFPiQYbXWUorga2aqZJ0z"></script>
Copied. Now place it just before </body> on your pages.