Created
March 9, 2025 11:13
-
-
Save thangman22/56537f3ac74d509fb18b6d0ae2a4add8 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
if (HTMLScriptElement.supports?.('speculationrules')) { | |
const specScript = document.createElement('script'); | |
specScript.type = 'speculationrules'; | |
const specRules = { | |
prerender: [ | |
{ | |
urls: ['/next.html'], | |
}, | |
], | |
}; | |
specScript.textContent = JSON.stringify(specRules); | |
document.body.append(specScript); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment