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

- 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.
This commit is contained in:
Dmitry Gozman 2021-02-03 08:47:52 -08:00 committed by GitHub
parent 985dd5666f
commit 4cad34509f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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 }));