Implement external <script type=speculationrules>
Categories
(Core :: DOM: Core & HTML, enhancement)
Tracking
()
People
(Reporter: vizlatin, Unassigned)
Details
User Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/143.0.0.0 Safari/537.36 Edg/143.0.0.0
Steps to reproduce:
Add speculation rules to an HTML doc using <script type="speculationrules" src="<source>" ... </script>
Actual results:
Not supported - currently speculation rules can only be added as inline scripts or HTTP response header
Expected results:
It is expected that developers can add speculation rules via external script, in addition to inline script, to easily reuse speculation rules across documents
Comment 1•8 months ago
|
||
You'd need to get the specification changed first. At the moment it says
-
inline script elements with their type attribute set to "speculationrules"; or
-
resources fetched from a URL specified in the
Speculation-RulesHTTP response header.
(In reply to Robert Longson [:longsonr] from comment #1)
You'd need to get the specification changed first. At the moment it says
inline script elements with their type attribute set to "speculationrules"; or
resources fetched from a URL specified in the
Speculation-RulesHTTP response header.
The spec change is in progress here: https://github.com/whatwg/html/pull/11697. Would appreciate any feedback and confirmation that there is cross-browser support for this!
Description
•