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

🏗🚮 Remove deprecated AMP_CANARY cookie name from experiments.js #27183

Merged
merged 1 commit into from
Mar 17, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 2 additions & 13 deletions tools/experiments/experiments.js
Original file line number Diff line number Diff line change
Expand Up @@ -176,10 +176,7 @@ function build() {
});

if (isExperimentOn_(RTV_CHANNEL_ID)) {
// TODO(#25205): remove this once the CDN stops supporting the AMP_CANARY
// cookie.
rtvInput.value =
getCookie(window, '__Host-AMP_OPT_IN') || getCookie(window, 'AMP_CANARY');
rtvInput.value = getCookie(window, '__Host-AMP_OPT_IN');
rtvInput.dispatchEvent(new Event('input'));
document.getElementById('rtv-details').open = true;
}
Expand Down Expand Up @@ -282,10 +279,7 @@ function updateExperimentRow(experiment) {
* @return {boolean}
*/
function isExperimentOn_(id) {
// TODO(#25205): remove this once the CDN stops supporting the AMP_CANARY
// cookie.
const optInCookieValue =
getCookie(window, '__Host-AMP_OPT_IN') || getCookie(window, 'AMP_CANARY');
const optInCookieValue = getCookie(window, '__Host-AMP_OPT_IN');
switch (id) {
case EXPERIMENTAL_CHANNEL_ID:
return [
Expand Down Expand Up @@ -331,11 +325,6 @@ function setAmpOptInCookie_(cookieState) {
validUntil,
cookieOptions
);
// TODO(#25205): remove this once the CDN stops supporting the AMP_CANARY
// cookie.
// Set explicit domain, so the cookie gets sent to sub domains.
cookieOptions.domain = location.hostname;
setCookie(window, 'AMP_CANARY', cookieState, validUntil, cookieOptions);
// Reflect default experiment state.
self.location.reload();
}
Expand Down