← Back to release summary

Speculation rules: infer "source" if possible

Category
Performance
Type
No developer-visible change
Status
In development (Chrome In development)
Intent stage
None

Summary

This allows speculation rules to be written more concisely if the type of the rule is not ambiguous (i.e., most cases). For example: {"source":"list","urls":["https://example.com/"]} can be written {"urls":["https://example.com/"]} and {"source":"document","where":{"selector_matches":"#nav > a"}} can be written {"where":{"selector_matches":"#nav > a"}} Existing rules (with explicit "source") continue to work with no change. See https://github.com/WICG/nav-speculation/pull/295.

Motivation

This makes writing rules more concise in cases where it's not ambiguous. We want to make this short, simple and easy.

Standards & signals

View on chromestatus.com