Skip to content

Commit 378c955

Browse files
attempts to improve site speed and avoid constant reloading
1 parent 2299099 commit 378c955

File tree

15 files changed

+57
-14
lines changed

15 files changed

+57
-14
lines changed
44.6 KB
Loading
69 KB
Loading
72.8 KB
Loading
99.7 KB
Loading
67.5 KB
Loading
83.1 KB
Loading
51.2 KB
Loading
102 KB
Loading
54.4 KB
Loading
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
/*! instant.page v5.1.0 - (C) 2019 Alexandre Dieulot - https://instant.page/license */
2+
document.addEventListener("DOMContentLoaded", function () {
3+
const supportsPrefetch = document.createElement("link").relList.supports("prefetch");
4+
if (!supportsPrefetch) return;
5+
const links = document.querySelectorAll("a[href]");
6+
links.forEach(link => {
7+
link.addEventListener("mouseover", () => {
8+
const prefetch = document.createElement("link");
9+
prefetch.rel = "prefetch";
10+
prefetch.href = link.href;
11+
document.head.appendChild(prefetch);
12+
});
13+
});
14+
});

0 commit comments

Comments
 (0)