-
Notifications
You must be signed in to change notification settings - Fork 3.1k
Add external <script type=speculationrules> #11697
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
0f1c473 to
59d995a
Compare
noamr
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for working on this! See initial comments.
source
Outdated
| data-x="concept-request-url">URL</span> is <var>url</var>, <span | ||
| data-x="concept-request-client">client</span> is <var>document</var>'s <span>relevant settings | ||
| object</span>, <span data-x="concept-request-destination">destination</span> is "<code | ||
| data-x="">speculationrules</code>", and <span data-x="concept-request-mode">mode</span> is |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This destination needs to be defined in the fetch spec.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There's a change in progress here: whatwg/fetch#1841. Happy to help with that one, is there a proper order for merging the changes across specs?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Merging them as close together as possible provided they are both unblocked and generally agreed upon is fine. But regarding this PR: is there cross-browser interest in this feature overall? The PR template is pretty scant.
|
See #11697 (comment), but just so the sentiment doesn't get lost in that thread, let me ask here: is there cross-browser support for this? I'm asking because the PR template is a bit bare and I'm not sure where other folks stand on this PR, although I'm happy to review it. |
Add external <script type="speculationrules">
Allows a speculation rules script element to have a src pointing to a
file of speculation rules, enabling developers to easily reuse a set of
speculation rules across HTML documents.
WICG/nav-speculation#348
Spec changes:
Add a row for external speculation rules in the attributes table of
4.12.1 The script element
During prepare the script element, handle the case where
srccontent attribute is present and
typeis"speculationrules"Define a "fetch speculation rules" algorithm to be used by both the
external script and 7.6.3 The
Speculation-Rulesheader sections.(See WHATWG Working Mode: Changes for more details.)
/scripting.html ( diff )
/speculative-loading.html ( diff )
/webappapis.html ( diff )