Last active
June 7, 2024 18:01
-
-
Save tunetheweb/98a1324b0624d8c90e046e69c7069a24 to your computer and use it in GitHub Desktop.
Inject Speculation Rules
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Paste this into console to prerender all links on hover | |
function prerenderInAction() { | |
const script_ = document.createElement('script'); | |
script_.type = 'speculationrules'; | |
script_.textContent = ` | |
{ | |
"prerender": [ | |
{ | |
"where": { | |
"href_matches": "/*" | |
}, | |
"eagerness": "moderate" | |
} | |
] | |
} | |
`; | |
document.head.appendChild(script_); | |
} | |
prerenderInAction(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment