v146 · origin trial · performance

Speculation rules: form_submission field

Speculation rules gain a form_submission field that lets sites prerender a destination as if it were the result of a form GET — for example, a search results page reached via a /search?q=… submission. The prerender is activated when the user submits the matching form.

concepts

  1. Speculation Rule Builder

    Compose a speculation rule with the new form_submission field and see the resulting JSON. Useful for site operators planning their prerender strategy.

  2. Live Search Prerender

    A real form with a real speculation rule installed. The results page checks performance.getEntriesByType('navigation')[0].activationStart and reports whether it was painted ahead of time — the canonical search-form use case from the WICG explainer.

  3. Prerender trigger tracer

    Edit the rule, the form, and the typed value — the tracer walks the matching algorithm step by step, reports the URL it would prerender, and explains why a skip happened.

  4. Form Prerender Lab

    A search form targeting /results?q=… with a configurable minimum-length threshold slider dynamically injects a speculationrules script tag as the user types, with a visual dot indicator. A timestamped prerender log captures trigger / ready / nav / miss events. Timing comparison cards compare prerender vs cold nav, and a before/after rules viewer shows the injected JSON.

why it shipped

The most common navigation on a content site is a search submission: a user types into a box, hits enter, and the page reloads with ?q=…. That's also the most common case where prerender would help — the destination URL is predictable, and the result feels instant if the prerendered page is already warm. Until now, speculation rules could prerender static URLs but not form-derived ones. The form_submission field plugs the gap: the rule tells the browser "if a form with these parameters submits, the destination is X" and the browser prerenders X ahead of time.

references