Skip to content

Commit

Permalink
fix(oopifs): do not emulate focus in oopifs (#5270)
Browse files Browse the repository at this point in the history
- We don't need this, since it should propagate from the main frame.
- Forcing focus in oopif immediately focuses it and blurs currently
  focused frame. This leads to undesired side effects, e.g. selects
  being closed.
  • Loading branch information
dgozman committed Feb 3, 2021
1 parent 985dd56 commit 4cad345
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/server/chromium/crPage.ts
Expand Up @@ -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 }));
Expand Down

0 comments on commit 4cad345

Please sign in to comment.