Skip to content
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

Referrer #80

Closed
annevk opened this issue Jul 15, 2015 · 12 comments
Closed

Referrer #80

annevk opened this issue Jul 15, 2015 · 12 comments

Comments

@annevk
Copy link
Member

annevk commented Jul 15, 2015

This is my current thinking with regards to integrating referrer support into Fetch (and the fetch() API).

Referrer should be copied from an existing Request object. However, it should be reset if any modifications are made to that Request object. This addresses the pass-through scenario for service workers and in particular the CORS CSS case (where the referrer is not same-origin). See also w3c/webappsec#413

Referrer should be allowed to be set to any same-origin URL (already possible through pushState() and other tricks).

Referrer should be allowed to be omitted.

Referrer will of course always be subject to the referrer policy of request's client.

In order to support the proposed referrer="" attribute there would also have to be a request's referrer policy (with referrer="" mapping to that rather than request's referrer). It's unclear at the moment what wins between a request's referrer policy and a request's client's referrer policy, though @sc0ttbeardsley from Yahoo! has expressed a preference for letting request's referrer policy win which seems to violate the spirit of CSP... See also w3c/webappsec#409

@jeisinger and @mikewest, any chance we can resolve this quickly?

@annevk
Copy link
Member Author

annevk commented Jul 15, 2015

http://krijnhoetmer.nl/irc-logs/whatwg/20150715#l-431 makes this more or less resolved.

@sc0ttbeardsley
Copy link

I'd be open to some other mechanism to allow certain page transitions to have a different policy than the document-level policy. Last I checked Chrome allows changing the document's meta referrer value via JS which works too, I suppose.

@jeisinger
Copy link
Member

the conclusion was to add an attribute like referrerPolicy (not referrer, as that's already the referrer itself in fetch), and have it reflect valid values.

@annevk annevk closed this as completed in 3a21ed3 Jul 16, 2015
@wanderview
Copy link
Member

Gecko implementation bug: https://bugzilla.mozilla.org/show_bug.cgi?id=1184549

@mfalken
Copy link

mfalken commented Jul 27, 2015

Blink implementation bug: https://code.google.com/p/chromium/issues/detail?id=514092

@yutakahirano
Copy link
Member

  • global referrer policy should be used when request's referrer policy is the empty string.
  • request's referrer policy should be used otherwise

Is that correct?

@annevk
Copy link
Member Author

annevk commented Aug 10, 2015

Yeah. A request's referrer policy takes precedence over a request's client's referrer policy.

@annevk
Copy link
Member Author

annevk commented Aug 10, 2015

The details of that need to be defined in the Referrer Policy Standard, though.

@yutakahirano
Copy link
Member

Thank you!

@yutakahirano
Copy link
Member

@annevk, @mikewest, @jeisinger, can you tell me how stable this feature is?
I have a chromium patch enabling RequestInit.referrer, but I'm a bit nervous about the spec stability, given that we are unshipping request context now.

@annevk
Copy link
Member Author

annevk commented Aug 18, 2015

My main worry would be that it has not received much scrutiny. Usually folks notice at least a few mistakes. So I'm not sure many have studied and approved the feature.

@yutakahirano
Copy link
Member

Thanks, then I'll wait for a while.

MXEBot pushed a commit to mirror/chromium that referenced this issue Jan 16, 2016
This CL enables fetch() users to set referrer property of a Request. Instead
of sending the "default" referrer, a user can control request's referrer
by specifying RequestInit.referrer. Additionally, as an intercepted
request in ServiceWorker already has a request referrer, the referrer
will be used when issuing fetch with the request.

Reflecting the original referrer policy on a ServiceWorker request is
disabled by this change: this CL makes all fetch Requests have the default
referrer policy.

Spec discussion: whatwg/fetch#80
Intent to Implement and Ship: https://groups.google.com/a/chromium.org/forum/#!topic/blink-dev/m-gMobqmNfk
BUG=514092

Review URL: https://codereview.chromium.org/1291073004

git-svn-id: svn://svn.chromium.org/blink/trunk@202257 bbb929c8-8fbe-4397-9dbb-9b2b20218538
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

6 participants