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

HTTP Referrer-Policy - change to default #9303

Merged
merged 7 commits into from
Mar 9, 2021

Conversation

hamishwillee
Copy link
Contributor

@hamishwillee hamishwillee commented Mar 1, 2021

The default HTTP Referrer-Policy changed from no-referrer-when-downgrade to strict-origin-when-cross-origin in Firefox 87 (https://bugzilla.mozilla.org/show_bug.cgi?id=1589074) as a result of this spec change: whatwg/fetch#1066. The change will also affect chrome and others.

In addition, the MDN page has some notes about setting the default which I understand we'd now include in BCD (reproduced below):

image

This first draft just puts all of these things as notes . What I THINK needs to happen is that we have a new subfeature to indicate the version at which strict-origin-when-cross-origin is used as the default. So if this is false or unknown the assumption is that the default is no-referrer-when-downgrade. Does that make sense? The other notes from the box above would then be re-worked without all the detail about the "default default" :-)

Does that make sense? If so, any suggestions for the feature name and description?

@ddbeck Your advice appreciated.

Note, this impacts FF content update: mdn/content#2516

@github-actions github-actions bot added the data:http Compat data for HTTP features. https://developer.mozilla.org/docs/Web/HTTP label Mar 1, 2021
@ddbeck
Copy link
Collaborator

ddbeck commented Mar 2, 2021

  1. have a new subfeature to indicate the version

    Right. I'd probably have a subfeature of http.headers.Referrer-Policy with a description like "Default policy is strict-origin-when-cross-origin". Maybe name the feature default_strict-origin-when-cross-origin

  2. For the notes in the screenshot:

    • I'd remove the notes from the page.
    • I'd ignore the network.http.referer.userControlPolicy setting. It's not a preview of a forthcoming feature so I don't think it's part of the compat story.
    • I'd include a Firefox 59-87 support statement for the default behind a flag (network.http.referer.defaultPolicy), in the aforementioned new feature. Given the schema, you'll have to mention the private browsing mode in a note separately.

@hamishwillee
Copy link
Contributor Author

hamishwillee commented Mar 8, 2021

@ddbeck Thanks. I have added the new subfeature default_strict-origin-when-cross-origin with v87 for FF, v85 for chromium (and equivalent for friends) and false for Safari (open bug still). I have removed these notes from the parent feature:

,
              "notes": [
                "Firefox version 87 and later have a default <code>Referrer-Policy</code> of <code>strict-origin-when-cross-origin</code>. This default can be changed using the preference <code>network.http.referer.userControlPolicy</code>, where <code>0 = no-referrer</code>, <code>1 = same-origin</code>, <code>2 = strict-origin-when-cross-origin</code>, <code>3 = no-referrer-when-downgrade</code>.",
                "Firefox versions 59 to 86 have a default <code>Referrer-Policy</code> of <code>3 = no-referrer-when-downgrade (default)</code>. This default can be change using the preference <code>network.http.referer.defaultPolicy</code> (and <code>network.http.referer.defaultPolicy.pbmode</code> for private networks), where <code>0 = no-referrer</code>, <code>1 = same-origin</code>, <code>2 = strict-origin-when-cross-origin</code>, <code>3 = no-referrer-when-downgrade (default)</code>.",
                "Firefox versions 53 to 58 allow the default <code>Referrer-Policy</code> to be set using the preference <code>network.http.referer.userControlPolicy</code>, where <code>0 = no-referrer</code>, <code>1 = same-origin</code>, <code>2 = strict-origin-when-cross-origin</code>, <code>3 = no-referrer-when-downgrade (default)</code>."
              ]

But I don't understand the rest of the instruction, in particular

  • I'd ignore the network.http.referer.userControlPolicy setting. It's not a preview of a forthcoming feature so I don't think it's part of the compat story.
  • I'd include a Firefox 59-87 support statement for the default behind a flag (network.http.referer.defaultPolicy), in the aforementioned new feature. Given the schema, you'll have to mention the private browsing mode in a note separately.

network.http.referer.userControlPolicy and network.http.referer.defaultPolicy do the same thing - they allow you to set the default preference (from strict-origin-when-cross-origin and no-referrer-when-downgrade respectively), while network.http.referer.defaultPolicy.pbmode lets you set the default for private mode browsing, which happens to already be strict-origin-when-cross-origin - so nothing has changed for private mode.

Point being if it isn't worth documenting one, I don't see why we'd document any as a compatibility thing.

If this is worth doing, you're going to have to show me how. I don't understand how this could work in the schema. Sorry!

Copy link
Collaborator

@ddbeck ddbeck left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry, I misunderstood the default policy setting bug (I thought it was a way to opt-in into the new default, but that's exactly wrong). One small change needed here, then we'll be ready to go.

http/headers/referrer-policy.json Outdated Show resolved Hide resolved
Co-authored-by: Daniel D. Beck <daniel@ddbeck.com>
@hamishwillee
Copy link
Contributor Author

hamishwillee commented Mar 8, 2021

Done. Thanks very much!

I know it isn't compatibility, but finding a place for those default firefox preferences is tough.

Copy link
Collaborator

@ddbeck ddbeck left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you! 🎉

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
data:http Compat data for HTTP features. https://developer.mozilla.org/docs/Web/HTTP
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants