Skip to content

Playwright is a framework for Web Testing and Automation. It allows testing Chromium, Firefox and WebKit with a single API.

fix(oopifs): do not emulate focus in oopifs (#5270)

Dmitry Gozman4cad34509f6d
diff --git a/src/server/chromium/crPage.ts b/src/server/chromium/crPage.ts
index eebdbdb4a6..1387069e90 100644
--- a/src/server/chromium/crPage.ts
+++ b/src/server/chromium/crPage.ts
@@ -445,8 +445,9 @@ class FrameSession {
}),
this._networkManager.initialize(),
this._client.send('Target.setAutoAttach', { autoAttach: true, waitForDebuggerOnStart: true, flatten: true }),
- this._client.send('Emulation.setFocusEmulationEnabled', { enabled: true }),
];
+ if (this._isMainFrame())
+ promises.push(this._client.send('Emulation.setFocusEmulationEnabled', { enabled: true }));
const options = this._crPage._browserContext._options;
if (options.bypassCSP)
promises.push(this._client.send('Page.setBypassCSP', { enabled: true }));