Chrome APIsadvanced
The Speculation Rules API to prerender the next likely page
const injectedUrls = new Set<string>();
export const prerenderOnHoverIntent = (link: HTMLAnchorElement, dwellMs = 200) => {
if (!(globalThis as any).HTMLScriptElement?.supports?.("speculationrules")) return;
let timer = 0;A dynamically-injected <script type=speculationrules> can prerender a hovered link in the background, so the click lands on an already-rendered page.