← Back to release summary

Speculation rules: target_hint field

Category
Performance
Type
New or changed feature
Status
Origin trial (Chrome 138)
Intent stage
None

Summary

This extends speculation rules syntax to allow developers to specify the target_hint field. This field provides a hint to indicate a target navigable where a prerendered page will eventually be activated. For example, when _blank is specified as a hint, a prerendered page can be activated for a navigable opened by window.open(). The field has no effect on prefetching. The specification allows this field to accept any strings that are valid as navigable target name or keyword as the value, but this launch supports only one of "_self" or "_blank" strings. If the hint is not specified, it's treated like "_self" is specified.

Motivation

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. See https://github.com/WICG/nav-speculation/issues/168 for details.

Standards & signals

Samples: https://prerender2-specrules.glitch.me

Explainers: https://github.com/WICG/nav-speculation/blob/main/triggers.md#window-name-targeting-hints

View on chromestatus.com