Open Bug 2008350 Opened 8 months ago Updated 4 months ago

Implement external <script type=speculationrules>

Categories

(Core :: DOM: Core & HTML, enhancement)

enhancement

Tracking

()

UNCONFIRMED

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

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-Rules HTTP response header.

Component: Untriaged → DOM: Core & HTML
Product: Firefox → Core
Version: Firefox 148 → unspecified

(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-Rules HTTP 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!

You need to log in before you can comment on or make changes to this bug.