Repository navigation
Conversation
This upstreams the monkeypatches from https://wicg.github.io/nav-speculation/speculation-rules.html#content-security-policy. At a high level, the additions are: - A new directive, `inline-speculation-rules`, which can be used if developers want to block inline JavaScript `<script>`s but allow inline `<script type=speculationrules>`s. This is done by introducing a new script type, `script speculationrules`, to sit alongside the existing `script` and `script attribute` types; HTML passes this new value in. - Handling of the new `"speculationrules"` request destination, which is used by the `Speculation-Rules` HTTP header. It cannot be blocked by CSP.
22806ee to
4e8aad7
Compare
|
We don't need the keyword |
|
IIUC (please correct me if wrong) this PR contains a major behavior changes that would break existing websites without updates to pages' CSP : To avoid breakage, pages should e.g. add cc/ @tunetheweb @nhiroki WDYT? FYI Also see whatwg/html#11697 (comment) whatwg/html#11697 (comment) and around for previous context for direction/planning around external speculation rules. |
|
Also this PR applies |
|
Yes I thought we’d previously agreed that the HTTP Header version was out of scope? Because if you’ve the ability to set HTTP Headers then you’ve no guarantees on CSP anyway (since that is also usually set via HTTP Headers). Also can I understand what this does for |
|
CSP should apply to links in HTTP headers as well to remain consistent. |
|
Hi all, based on the latest discussion here, particularly the concern about breaking existing pages (#808 (comment)), I propose this revised plan to avoid breakage until Stage 1 - external
Stage 2 -
Note on What do you all think? If this sounds right, I can proceed with updating the specs and CL for Stage 1. |
|
The incremental approach looks good to me (it's more like whatwg/html#11697 (comment) ), but I defer to @tunetheweb (speculation rules ecosystem) and @antosart (CSP) for details -- WDYT? |
|
Wrt your proposed plan, I believe it mostly applies to your implementation:
If that's correct, the spec change looks fine to me modulo the comment above. |
7112c2f to
65da675
Compare
@antosart I believe we are on the same page, we won't define |
|
From my perspective this is a step backwards rather than forwards, for a number of reasons:
I agree As to the whether HTTP Header Speculation Rules should be subject to CSP at all, that seems a separate conversation to what @vickiez seems interested in solving here ( |
|
I see what you mean, I have no objection to adding Thanks for providing the customer context for exempting the header, I’ll revive the conversation on the Fetch spec. For now, can we proceed with the |
Adds the following:
From #776:
New additions:
speculation-rules-srcfetch directive that restricts the sources from which speculation rules may be loaded, whether via <script> elements or the Speculation-Rules HTTP response headerspeculation-rules-src→script-src-elem→script-src→default-src, applied uniformly to both inline and external speculation rulesspeculation-rules-src(removing the previous header exemption that returned null).This reflects the agreed plan from whatwg/html#11697
Preview | Diff