From b20e154902e3e6062ecb001018799b7e01012c1c Mon Sep 17 00:00:00 2001 From: Simon Knott Date: Thu, 1 Aug 2024 18:28:40 +0200 Subject: [PATCH] cherry-pick(#31958): fix(ui): only populate settings once (#31963) Cherry-picks https://github.com/microsoft/playwright/pull/31958 into the release. --- packages/playwright-core/src/server/launchApp.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/packages/playwright-core/src/server/launchApp.ts b/packages/playwright-core/src/server/launchApp.ts index 12cb343f95..eab457691c 100644 --- a/packages/playwright-core/src/server/launchApp.ts +++ b/packages/playwright-core/src/server/launchApp.ts @@ -90,6 +90,8 @@ export async function syncLocalStorageWithSettings(page: Page, appName: string) // iframes w/ snapshots, etc. if (location && location.protocol === 'data:') return; + if (window.top !== window) + return; Object.entries(settings).map(([k, v]) => localStorage[k] = v); (window as any).saveSettings = () => { (window as any)._saveSerializedSettings(JSON.stringify({ ...localStorage }));