Intent to Ship: `referrerpolicy` attribute

81 views
Skip to first unread message

Emily Stark

unread,
Feb 23, 2016, 1:23:21 AM2/23/16
to blink-dev, Jochen Eisinger, Mike West

Contact emails

est...@chromium.org


Spec

https://w3c.github.io/webappsec/specs/referrer-policy/

https://github.com/w3ctag/spec-reviews/issues/36


Summary

The `referrerpolicy` attribute allows a developer to set a referrer policy for certain HTML elements, which determines how the Referer header is set for requests issued while loading these elements. The attribute applies to <a>, <area>, <img>, and <iframe> elements.


Link to “Intent to Implement” blink-dev discussion

https://groups.google.com/a/chromium.org/d/msg/blink-dev/tBn5cU26N9Q/R9vtH0XaBQAJ

https://groups.google.com/a/chromium.org/forum/#!topic/blink-dev/unaEzikvU1g


Is this feature supported on all six Blink platforms (Windows, Mac, Linux, Chrome OS, Android, and Android WebView)?

Yes.


Interoperability and Compatibility Risk

Firefox 45 is shipping a compatible implementation: https://groups.google.com/forum/#!msg/mozilla.dev.platform/TXFImc_r9Jo/iW_5u0ICCwAJ

Mozilla has been very active in driving the specification of this attribute: https://lists.w3.org/Archives/Public/public-webappsec/2015Feb/0282.html

I recently updated the web platform tests for this attribute to help us make sure that our implementations are compatible: https://github.com/w3c/web-platform-tests/pull/2550


OWP launch tracking bug

crbug.com/490608


Link to entry on the feature dashboard

https://www.chromestatus.com/features/5743723954569216



Mike West

unread,
Feb 23, 2016, 2:00:00 AM2/23/16
to Emily Stark, blink-dev, Jochen Eisinger
Non-owner's LGTM from me. Thanks for doing the work to implement this interoperably with Firefox. It's a good step forward from the status-quo global policy flag for a page, and should give folks the opportunity to curtail leakage from their sites.

-mike

-mike

Jochen Eisinger

unread,
Feb 23, 2016, 2:51:46 AM2/23/16
to Mike West, Emily Stark, blink-dev
lgtm1

the attribute also allows for feature detection, as it reflects only valid referrer policy values.

TAMURA, Kent

unread,
Feb 23, 2016, 11:56:27 PM2/23/16
to Jochen Eisinger, Mike West, Emily Stark, blink-dev
LGTM2.

--
TAMURA Kent
Software Engineer, Google


Chris Harrelson

unread,
Feb 24, 2016, 11:13:44 AM2/24/16
to TAMURA, Kent, Jochen Eisinger, Mike West, Emily Stark, blink-dev
LGTM3

--
You received this message because you are subscribed to the Google Groups "blink-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to blink-dev+...@chromium.org.

Philip Jägenstedt

unread,
Feb 24, 2016, 11:26:30 AM2/24/16
to TAMURA, Kent, Jochen Eisinger, Mike West, Emily Stark, blink-dev
Is https://w3c.github.io/webappsec-referrer-policy/#authoring wrong?

It says that "unknown policy values will be ignored, and when multiple sources specify a referrer policy, the value of the latest one will be used" but AFAICT that isn't what the spec says, nor is it what is SecurityPolicy::referrerPolicyFromString does.

Jochen Eisinger

unread,
Feb 24, 2016, 11:30:25 AM2/24/16
to Philip Jägenstedt, TAMURA, Kent, Mike West, Emily Stark, blink-dev

Philip Jägenstedt

unread,
Feb 24, 2016, 11:37:25 AM2/24/16
to Jochen Eisinger, TAMURA, Kent, Mike West, Emily Stark, blink-dev
Oh, I didn't read very carefully. One can use multiple meta elements, and the last recognized one will be used. I was thinking something like <a href="..." referrerpolicy="no-referrer new-policy"> but that's not what this section is talking about, and that wouldn't work.

LGTM4

Yutaka Hirano

unread,
Feb 24, 2016, 4:11:35 PM2/24/16
to Philip Jägenstedt, Jochen Eisinger, TAMURA, Kent, Mike West, Emily Stark, blink-dev
Currently the Fetch API implementation relies on an assumption that the referrer policy of a request is always default (See https://code.google.com/p/chromium/codesearch#chromium/src/third_party/WebKit/Source/modules/fetch/FetchManager.cpp&l=550). This change breaks the assumption with a service worker, right?

Emily Stark

unread,
Feb 24, 2016, 4:49:21 PM2/24/16
to Yutaka Hirano, Philip Jägenstedt, Jochen Eisinger, TAMURA, Kent, Mike West, Emily Stark, blink-dev
On Wed, Feb 24, 2016 at 1:11 PM, Yutaka Hirano <yhi...@chromium.org> wrote:
Currently the Fetch API implementation relies on an assumption that the referrer policy of a request is always default (See https://code.google.com/p/chromium/codesearch#chromium/src/third_party/WebKit/Source/modules/fetch/FetchManager.cpp&l=550). This change breaks the assumption with a service worker, right?

Hi Yutaka -- I'm sorry, I don't understand, could you explain bit more? How does this change break that assumption?
Thanks,
Emily

Yutaka Hirano

unread,
Feb 24, 2016, 5:12:44 PM2/24/16
to Emily Stark, Philip Jägenstedt, Jochen Eisinger, TAMURA, Kent, Mike West, blink-dev, Matt Falkenhagen
+falken@

Sorry for not being clear.
What happens when you trap a <img referrerpolicy=...> request in the following service worker?
self.addEventListener('fetch', e => {
  e.respondWith(fetch(e.request))
});

IIUC the fetch spec requires us to transfer request's referrer policy (in this case, the referrer policy set via the attribute) to service workers. Currently we don't implement it because no one sets request's referrer policy.

Yutaka Hirano

unread,
Feb 24, 2016, 7:59:36 PM2/24/16
to Emily Stark, Philip Jägenstedt, Jochen Eisinger, TAMURA, Kent, Mike West, blink-dev, Matt Falkenhagen
Talked offline.

The current implementation doesn't give request's referrer policy to the service worker. That means the referrer policy will be cleared in the service worker and the assumption in modules/fetch is still valid. This feature may heighten the priority of the referrer policy handling implementation in modules/fetch a bit.

Jochen Eisinger

unread,
Feb 25, 2016, 3:10:56 AM2/25/16
to Yutaka Hirano, Emily Stark, Philip Jägenstedt, TAMURA, Kent, Mike West, blink-dev, Matt Falkenhagen
yeah, referrer policies have shipped since three years or so. Maybe not breaking them in SW would be nice :(

Yoav Weiss

unread,
Oct 25, 2016, 8:58:51 AM10/25/16
to Jochen Eisinger, Yutaka Hirano, Emily Stark, Philip Jägenstedt, TAMURA, Kent, Mike West, blink-dev, Matt Falkenhagen
While the attribute was implemented, it wasn't implemented on `<link>`.

I have an in-progress CL adding support for that attribute on `<link rel=preload>`, and I'm likely to follow up on it with stylesheet, prefetch and icon.

Would those require a separate "intent to ship" or just notifying this thread enough?

Also, the current attribute is shipped with legacy values as well as the current spec ones. I intend to break that tradition with `<link>` and only ship the current spec values, as no content depends on the legacy values.

Does all that make sense?

To unsubscribe from this group and stop receiving emails from it, send an email to blink-dev+unsubscribe@chromium.org.

--
You received this message because you are subscribed to the Google Groups "blink-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to blink-dev+unsubscribe@chromium.org.




--
You received this message because you are subscribed to the Google Groups "blink-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to blink-dev+unsubscribe@chromium.org.

Jochen Eisinger

unread,
Oct 25, 2016, 9:07:10 AM10/25/16
to Yoav Weiss, Yutaka Hirano, Emily Stark, Philip Jägenstedt, TAMURA, Kent, Mike West, blink-dev, Matt Falkenhagen
Let's do an intent to ship - that's easier to track for those who write blog posts about releases etc..

To unsubscribe from this group and stop receiving emails from it, send an email to blink-dev+...@chromium.org.

--
You received this message because you are subscribed to the Google Groups "blink-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to blink-dev+...@chromium.org.




--
You received this message because you are subscribed to the Google Groups "blink-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to blink-dev+...@chromium.org.

Joe Medley

unread,
Oct 25, 2016, 1:30:38 PM10/25/16
to Jochen Eisinger, Yoav Weiss, Yutaka Hirano, Emily Stark, Philip Jägenstedt, TAMURA, Kent, Mike West, blink-dev, Matt Falkenhagen
+1

Joe Medley | Technical Writer, Chrome DevRel | jme...@google.com | 816-678-7195
If an API's not documented it doesn't exist.

To unsubscribe from this group and stop receiving emails from it, send an email to blink-dev+unsubscribe@chromium.org.

--
You received this message because you are subscribed to the Google Groups "blink-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to blink-dev+unsubscribe@chromium.org.




--
You received this message because you are subscribed to the Google Groups "blink-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to blink-dev+unsubscribe@chromium.org.

--
You received this message because you are subscribed to the Google Groups "blink-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to blink-dev+unsubscribe@chromium.org.

Reply all
Reply to author
Forward
0 new messages