Example 1 — Read document.prerendering
MDN-style status check while a page may be prerendering.
if (document.prerendering) {
console.log("got this far during prerendering!");
} else {
console.log("not prerendering");
} How It Works
- Read the boolean.
trueonly during active prerender. - Normal visits. Tutorial/editor loads usually print the else branch.
- Do not assign. The property is read-only.
- Feature-detect in real apps. The API is Experimental.

