Skip to Content
Platform.Ontology

Speculation Rules (prefetch and prerender)

A page can tell the browser to load and render the next page in the background.

Does something on your deviceThings a page can doWindows and navigationWeb browsersWhile you use it

In one line

Can tell your browser to load the likely next page before you tap

A page can tell the browser to load and render the next page in the background.

A site can preload other URLs the person may visit. Prerendered pages run scripts before the person arrives, so analytics and counters may fire on a visit that never happens.

What it can and can't do

What the user does: Nothing. It happens as you hover over or get close to a link.

It can

  • Load the next page in the background before you tap it
  • Show the next page right away when you do tap
  • Pick pages to preload on its own site

It cannot

  • Preload pages when your browser has data saver or low power on
  • Run the other page's sign in or purchase actions
  • Preload pages from other sites with your logged in details
  • Work in Firefox

How it differs between platforms: Chrome and Edge and Safari support it. Firefox does not yet.

Browser support

BrowserStatusFirst versionReleasedNote
ChromeSupported1092023-01-10None
EdgeSupported1092023-01-12None
FirefoxNot supportedNot availableNot listedIn preview builds only
SafariSupported27.3Not listedNone
Safari on iPhoneSupported27.3Not listedAll iOS browsers use WebKit
Chrome on AndroidSupported1092023-01-10None
Samsung InternetSupported21.02023-05-19None

How a site asks for it

API<script type=speculationrules>{"prerender":[...]}</script>; Speculation-Rules header
Browser compat keyshtml.elements.script.type.speculationrules
How access is grantednone
What the user seesNone (no browser prompt)
Needs a secure context (HTTPS)No
Needs a user gestureNo
Activationnone
How long it lastsWhile the page is open; discarded when not used
How to take it backNothing to revoke (no permission is stored)
Inside an iframeSame-site prerender by default; cross-origin prefetch needs opt-in

Typical flow

  1. Page injects speculation rules
  2. Browser fetches or prerenders per eagerness
  3. Navigation activates the prerendered page

Data you get

Shape: none

No individual data fields. The signal is the access itself.

Technical limits

  • Chrome limits: eagerness immediate or eager up to 50 prefetches and 10 prerenders; moderate or conservative up to 2 (FIFO)
  • Disabled when Data Saver or Energy Saver is on, when Preload pages is off, or memory is low
  • Prerendered pages defer permission prompts, notifications, geolocation and other sensitive APIs until activation
  • Cross-origin prerender is not allowed; same-site cross-origin prefetch needs opt in
  • Support per MDN BCD: Chrome and Edge 109, Safari 27.3; Firefox has not shipped it

The story

What it is

A page can tell the browser to load the next page before you click it.

For you

The next page appears almost instantly when you click. What you do not see is that your browser may have loaded it for you earlier, even if you never opened it.

For makers

Makers bet on where you will click next and load it early to boost speed, which lifts search ranking and sales. The cost is extra data use and the site may count visits you never made.

Where you see it

TypeExampleApps
shoppingOn a store listing, the top product page is loaded in the background so tapping it feels instant.Shopify stores, Amazon
newsA news site prerenders the next top story from the home page.None named
mediaA streaming service prefetches the title page of a show you are hovering over.None named
analyticsAnalytics must avoid counting prerendered pages that the person never actually viewed.Google Analytics
adsAn ad system waits to count an impression until a prerendered page is really shown.None named
travelA booking site prerenders the next step of search results.None named

Risks

  • Phantom page loads
  • Extra data use

What the platform says

Good uses and abuse

Legitimate uses

  • Instant navigations

Known abuse

  • Phantom analytics hits
  • Loading pages to disclose IP or cookies before click

Scores

ScoreValueMeaning
Sensitivity2 of 5How revealing the data is
Utility4 of 5How useful it is to honest apps
Friction0 of 5How much the user has to do
Fingerprint bitsNot ratedRough identifying entropy, when known

History

  • 2023-01, Chrome 109: Prefetch and prerender via speculation rules
  • 2023-12, Chrome 121: Document rules and eagerness
  • Fenced frames. Can embed a box of content that the page around it cannot look into

Sources

How well checked: Based on official documentation.

On this page