v135 · performance

Speculation rules: target_hint field

This extends speculation rules syntax to allow developers to specify the target_hint field.

concepts

  1. target_hint

    The raw rule shape: declare target_hint and observe the speculation rules registration.

  2. Pre-rendering for links that open in a new tab

    The middle-click use case from the explainer: sites that route most traffic to target="_blank" couldn't speed up the navigation. target_hint: "_blank" fixes that.

  3. target_hint router

    Pick navigation kind — _self, _blank, or a named target — and watch the speculation rule JSON build with the right target_hint. The verdict tells you whether Chrome can match the prerender on click.

  4. Prefetch Tester

    Build and inject live speculationrules scripts with target_hint. Configure rule type, target hint, and eagerness, then inject — see which sample links become eligible and read back the registered rule set. Toggle between with and without target_hint to see eligibility change for target="_blank" links.

why it shipped

In the Chromium implementation, we have accidentally created an architecture where it is hard to prerender a page without knowing what target window (or tab) it is going to be in. Currently we are always assuming that the prerender will be navigated to in the current window. The target_hint allows us to know a target window before starting prerendering.

references