-
Notifications
You must be signed in to change notification settings - Fork 341
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
Add referrer policy to blob-generated responses #306
Conversation
So for |
I don't really know. I am just trying to make referrer policy parallel to HTTPS state. I don't understand the issue with about:blank for either of the two. |
The issue is this, for referrer policy: If you have a subframe that you never load anything into, and then you inject some elements into it that do loads, what should those loads use as the referrer and why? |
The default referrer policy of "" (which in Fetch gets treated the same as "no-referrer-when-downgrade"), because there's no other natural choice? |
There is totally a natural choice: the referrer policy of the place where we get the referrer itself from: the parent page. |
Or put another way.... Whatever place it is that we propagate the value of referrer to things, we should propagate the value of the referrer policy in those same exact places. Anything else is just broken. |
Oh, I see. You are of course right. Yes, this should presumably be handled in HTML. It'd probably be done as part of w3c/webappsec-referrer-policy#40, since when we figure out how to apply |
Ah! It's already taken care of, I just had some trouble finding it due to the way navigation has like four different algorithms involved. https://html.spec.whatwg.org/multipage/browsers.html#creating-a-new-browsing-context step 6. |
Okay, so we don't have to fix this here? It does make more sense to handle this in HTML since a referrer policy is only relevant for something that ends up creating a document or worker. |
No, I meant the about:blank case is taken care of. Blob URLs should still be consistent between HTTPS state and referrer policy... |
The initial about:blank case is taken care of by https://html.spec.whatwg.org/multipage/browsers.html#creating-a-new-browsing-context What about non-initial about:blank? |
I think as currently specced that will be handled by the navigate algorithm, which will get a "response" for |
Yes, but what will it use for the referrer? |
Presumably it would follow the normal navigate logic, and use the page that it was navigated from? @annevk might know better. But I'm not sure what's tricky about that case... |
No, I mean if you navigate your subframe to about:blank and then inject an |
This is the responsibility of https://w3c.github.io/webappsec-referrer-policy/#determine-requests-referrer. By my reading it will reach step 3.3.3 (referrerSource = "about:blank"), but then step 4 will set referrerURL to I can't actually find where Fetch invokes https://w3c.github.io/webappsec-referrer-policy/#determine-requests-referrer; @annevk? The section https://w3c.github.io/webappsec-referrer-policy/#integration-with-fetch seems inaccurate. |
Main fetch step 8? |
Ah yes, thanks. So then, assuming |
OK. That seems fine, if it's what browsers do in practice... |
Thanks to @antosart policy container will be taking care of this. w3c/FileAPI#142 will track this going forward. |
As discussed in whatwg/html#1205 (comment).
Don't have Anolis installed so you'll need to regenerate.
/cc @bzbarsky