From 211503663087bac47e96c5a402c6b2f2aac61065 Mon Sep 17 00:00:00 2001 From: fairlighteth <31534717+fairlighteth@users.noreply.github.com> Date: Wed, 8 Jul 2026 15:15:31 +0100 Subject: [PATCH] chore: relax COOP on preview deploys --- apps/cowswap-frontend/vercel.ts | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/apps/cowswap-frontend/vercel.ts b/apps/cowswap-frontend/vercel.ts index f62838f3b3b..e1e1d5850ba 100644 --- a/apps/cowswap-frontend/vercel.ts +++ b/apps/cowswap-frontend/vercel.ts @@ -67,6 +67,8 @@ const csp = buildCsp([ ['upgrade-insecure-requests', []], ]) +const crossOriginOpenerPolicy = process.env.VERCEL_ENV === 'production' ? 'same-origin-allow-popups' : 'unsafe-none' + // --------------------------------------------------------------------------- // Vercel config // --------------------------------------------------------------------------- @@ -87,9 +89,8 @@ export const config: VercelConfig = { routes.header('/(.*)', [ // Controls which resources the browser is allowed to load; prevents XSS and data injection attacks. { key: 'Content-Security-Policy', value: csp }, - // Isolates the browsing context so cross-origin pages cannot access window.opener, - // while still allowing this page to open popups (needed for wallet connections). - { key: 'Cross-Origin-Opener-Policy', value: 'same-origin-allow-popups' }, + // Preview deploys use unsafe-none so Tag Assistant can keep its cross-origin debug connection. + { key: 'Cross-Origin-Opener-Policy', value: crossOriginOpenerPolicy }, // Allows any origin to load this page as an iframe, required for the embeddable widget. { key: 'Cross-Origin-Resource-Policy', value: 'cross-origin' }, // Prevents browsers from MIME-sniffing a response away from the declared Content-Type.