Skip to content

Commit

Permalink
Remove privacy sandbox origin trial (#39486)
Browse files Browse the repository at this point in the history
  • Loading branch information
powerivq authored Sep 27, 2023
1 parent 376f2fb commit 46f7597
Show file tree
Hide file tree
Showing 6 changed files with 0 additions and 56 deletions.
25 changes: 0 additions & 25 deletions ads/google/a4a/test/test-utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ import {
googleAdUrl,
groupAmpAdsByType,
maybeAppendErrorParameter,
maybeInsertOriginTrialToken,
mergeExperimentIds,
} from '#ads/google/a4a/utils';

Expand Down Expand Up @@ -1068,27 +1067,3 @@ describes.realWin('#groupAmpAdsByType', {amp: true}, (env) => {
});
});
});

describes.realWin('maybeInsertOriginTrialToken', {}, (env) => {
let doc;
let win;
beforeEach(() => {
win = env.win;
doc = win.document;
});

it('should insert the token', () => {
expect(doc.querySelector('meta[http-equiv=origin-trial]')).to.not.exist;
maybeInsertOriginTrialToken(win);
expect(doc.querySelector('meta[http-equiv=origin-trial]')).to.exist;
});

it('should only insert the token once on multiple calls', () => {
maybeInsertOriginTrialToken(win);
maybeInsertOriginTrialToken(win);
maybeInsertOriginTrialToken(win);
expect(
doc.querySelectorAll('meta[http-equiv=origin-trial]').length
).to.equal(1);
});
});
21 changes: 0 additions & 21 deletions ads/google/a4a/utils.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import {createElementWithAttributes} from '#core/dom';
import {whenUpgradedToCustomElement} from '#core/dom/amp-element-helpers';
import {DomFingerprint} from '#core/dom/fingerprint';
import {getPageLayoutBoxBlocking} from '#core/dom/layout/page-layout-box';
Expand Down Expand Up @@ -100,26 +99,6 @@ export const TRUNCATION_PARAM = {name: 'trunc', value: '1'};
const CDN_PROXY_REGEXP =
/^https:\/\/([a-zA-Z0-9_-]+\.)?cdn\.ampproject\.org((\/.*)|($))+/;

/** @const {string} */
const TOKEN_VALUE_3P =
'A6WNTKQHktfckG5CFrBnDpo3z+BJBC5yt/DyQZMpawyLL5/vrGaDhna4gkc+aZ4bQ/zzE7lO357DTV7QtF96pgYAAACEeyJvcmlnaW4iOiJodHRwczovL2FtcHByb2plY3Qub3JnOjQ0MyIsImZlYXR1cmUiOiJQcml2YWN5U2FuZGJveEFkc0FQSXMiLCJleHBpcnkiOjE2OTUxNjc5OTksImlzU3ViZG9tYWluIjp0cnVlLCJpc1RoaXJkUGFydHkiOnRydWV9';

/**
* Inserts origin-trial token for `attribution-reporting` if not already
* present in the DOM.
* @param {!Window} win
*/
export function maybeInsertOriginTrialToken(win) {
if (win.document.head.querySelector(`meta[content='${TOKEN_VALUE_3P}']`)) {
return;
}
const metaEl = createElementWithAttributes(win.document, 'meta', {
'http-equiv': 'origin-trial',
content: TOKEN_VALUE_3P,
});
win.document.head.appendChild(metaEl);
}

/**
* Returns the value of some navigation timing parameter.
* Feature detection is used for safety on browsers that do not support the
Expand Down
4 changes: 0 additions & 4 deletions extensions/amp-a4a/0.1/secure-frame.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,6 @@ const sandboxVals =
'allow-scripts ' +
'allow-top-navigation';

const TOKEN_VALUE_1P =
'Akf/tuirtbNmVRwhMztVypuINFmk7s/DbLzDDhE/yJp/PJdlTchTrby3C2btx+7B9+Iw6LKILMZA7OL2/dL2KgIAAABweyJvcmlnaW4iOiJodHRwczovL2FtcHByb2plY3Qub3JnOjQ0MyIsImZlYXR1cmUiOiJQcml2YWN5U2FuZGJveEFkc0FQSXMiLCJleHBpcnkiOjE2OTUxNjc5OTksImlzU3ViZG9tYWluIjp0cnVlfQ==';

/**
* Create the starting html for all FIE ads. If streaming is supported body will be
* piped in later.
Expand All @@ -55,7 +52,6 @@ export const createSecureDocSkeleton = (url, sanitizedHeadElements, body) =>
default-src 'none';
style-src ${fontProviderAllowList} 'unsafe-inline';
">
<meta http-equiv="origin-trial" content=${TOKEN_VALUE_1P}>
${sanitizedHeadElements}
</head>
<body>${body}</body>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ import {
isCdnProxy,
isReportingEnabled,
maybeAppendErrorParameter,
maybeInsertOriginTrialToken,
} from '#ads/google/a4a/utils';

import {
Expand Down Expand Up @@ -170,7 +169,6 @@ export class AmpAdNetworkAdsenseImpl extends AmpA4A {
*/
buildCallback() {
super.buildCallback();
maybeInsertOriginTrialToken(this.win);

// Convert the full-width tag to container width for desktop users.
if (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@ import {
isCdnProxy,
isReportingEnabled,
maybeAppendErrorParameter,
maybeInsertOriginTrialToken,
truncAndTimeUrl,
} from '#ads/google/a4a/utils';
import {getMultiSizeDimensions} from '#ads/google/utils';
Expand Down Expand Up @@ -566,7 +565,6 @@ export class AmpAdNetworkDoubleclickImpl extends AmpA4A {
buildCallback() {
super.buildCallback();
this.maybeDeprecationWarn_();
maybeInsertOriginTrialToken(this.win);
this.setPageLevelExperiments(this.extractUrlExperimentId_());
const pubEnabledSra = !!this.win.document.querySelector(
'meta[name=amp-ad-doubleclick-sra]'
Expand Down
2 changes: 0 additions & 2 deletions src/inabox/amp-inabox.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
*/

import '#polyfills';
import {maybeInsertOriginTrialToken} from '#ads/google/a4a/utils';

import {TickLabel_Enum} from '#core/constants/enums';
import * as mode from '#core/mode';
Expand Down Expand Up @@ -102,7 +101,6 @@ startupChunk(self.document, function initial() {
self.document,
function final() {
Navigation.installAnchorClickInterceptor(ampdoc, self);
maybeInsertOriginTrialToken(self);
maybeRenderInaboxAsStoryAd(ampdoc);
maybeValidate(self);
makeBodyVisible(self.document);
Expand Down

0 comments on commit 46f7597

Please sign in to comment.