-
Notifications
You must be signed in to change notification settings - Fork 78
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
Introduce 'prefetch-src'. Closes w3c/webappsec-csp#107. #283
Conversation
(For clarity: tests are coming in a subsequent patch once I figure out how prefetch works in Chrome :) ) |
Looks good, but I don't know enough about CSP's mechanics to approve. |
In whatwg/fetch#659 it's an initiator as per discussion in whatwg/fetch#658, in particular whatwg/fetch#658 (comment). |
So should Fetch still distinguish prerender and prefetch? It seems slightly cleaner to give them distinct initiators, even if they end up with the same path here. |
Happy to defer that to @yoavweiss. The CSP integration should be straightforward either way. |
Agree that it does seem cleaner. |
@yoavweiss can you update whatwg/fetch#659 so it lists both? |
updated. Also filed whatwg/html#3353 |
Updated this patch as well. WDYT? Tests for |
Looked into the Chrome prerender onload event issues, and they seem to be related to NoStatePrefetch and to the fact that prerender triggers a proprietary event, rather than the standard In the mean time it seems fine to add a test that fails, and which hopefully work once implementations are fixed. |
Yeah. I mean, we'll skip it because otherwise it will just timeout because we have no idea when to stop without an event, and I don't want to add several seconds to every test run. But we'll unskip it once it works! :) |
I'm happy with this. (And for clarity this means we'll tackle dns-prefetch et al in a separate PR.) |
Correct. This is just |
They are defined in https://w3c.github.io/resource-hints/ but we need to better tie them into Fetch. |
* 'master' of https://github.com/w3c/webappsec-csp: (209 commits) Fix a few typos (w3c#280) Introduce 'prefetch-src'. (w3c#283) Clarify navigation behavior for 'script-src'. Incorrect indentation of the navigation check algorithm. IDL amendments and small misc issues. (w3c#271) Regenerate HTMLs. Origin link. NoncedElement link. link up inline css issue (w3c#228) Replaced 'alias' with 'copy' for less ambiguity (w3c#273) Cleanup `global object` usage to make sense with `Documents` (w3c#254) Elements with duplicated attributes are not nonceable. s/not-example.com/example.org/ Linked testing policy and fixed a few links (w3c#263) Rebuild HTML. Fix linking errors to 'script-like' and 'applet'. Adds WorkletGlobalScope as a concept to CSP. (w3c#205) Slight correction of host matching description (w3c#251) Fixed ambigous grammar (w3c#250) Replace Request.type based logic with Request.destination (w3c#231) ...
Corresponding CSP change: w3c/webappsec-csp#283. Tests: web-platform-tests/wpt#9013. Closes #658.
@yoavweiss, @annevk, @andypaicu: WDYT?
/cc @dveditz, @ckerschb
Preview | Diff