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

Revert "Use resource-level referrer policy for attributionsrc requests" #46199

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
56 changes: 0 additions & 56 deletions attribution-reporting/referrer-policy.sub.https.html

This file was deleted.

2 changes: 2 additions & 0 deletions attribution-reporting/request-format.sub.https.html
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,9 @@
} else {
assert_not_own_property(requests[0], 'attribution-reporting-eligible');
}
assert_equals(requests[0].referer, location.toString());

// TODO(apaseltiner): Test various referrer policies.
// TODO(apaseltiner): Test cookie propagation.

const expectedURL = blankURL();
Expand Down
12 changes: 4 additions & 8 deletions attribution-reporting/resources/helpers.js
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,6 @@ const registerAttributionSrc = async ({
extraQueryParams = {},
reportingOrigin,
extraHeaders = [],
referrerPolicy = '',
}) => {
const searchParams = new URLSearchParams(location.search);

Expand Down Expand Up @@ -202,6 +201,7 @@ const registerAttributionSrc = async ({
headers.push({name, value: cookie});
}


let credentials;
if (method === 'fetch') {
const params = getFetchParams(reportingOrigin, cookie);
Expand All @@ -219,7 +219,6 @@ const registerAttributionSrc = async ({
switch (method) {
case 'img':
const img = document.createElement('img');
img.referrerPolicy = referrerPolicy;
if (eligible === null) {
img.attributionSrc = url;
} else {
Expand All @@ -237,7 +236,6 @@ const registerAttributionSrc = async ({
return 'event';
case 'script':
const script = document.createElement('script');
script.referrerPolicy = referrerPolicy;
if (eligible === null) {
script.attributionSrc = url;
} else {
Expand All @@ -251,7 +249,6 @@ const registerAttributionSrc = async ({
return 'event';
case 'a':
const a = document.createElement('a');
a.referrerPolicy = referrerPolicy;
a.target = '_blank';
a.textContent = 'link';
if (eligible === null) {
Expand All @@ -266,13 +263,12 @@ const registerAttributionSrc = async ({
return 'navigation';
case 'open':
await test_driver.bless('open window', () => {
const feature = referrerPolicy === 'no-referrer' ? 'noreferrer' : '';
if (eligible === null) {
open(
blankURL(), '_blank',
`attributionsrc=${encodeURIComponent(url)} ${feature}`);
`attributionsrc=${encodeURIComponent(url)}`);
} else {
open(url, '_blank', `attributionsrc ${feature}`);
open(url, '_blank', 'attributionsrc');
}
});
return 'navigation';
Expand All @@ -281,7 +277,7 @@ const registerAttributionSrc = async ({
if (eligible !== null) {
attributionReporting = JSON.parse(eligible);
}
await fetch(url, {credentials, attributionReporting, referrerPolicy});
await fetch(url, {credentials, attributionReporting});
return 'event';
}
case 'xhr':
Expand Down