fix(filechooser): quick fix for the headful file chooser (#5369)

Fixes #5363
This commit is contained in:
Pavel Feldman 2020-01-30 23:43:34 -08:00 committed by GitHub
parent 1a1ef83e8d
commit 9923e56b3e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -135,7 +135,6 @@ class Page extends EventEmitter {
this._client.send('Target.setAutoAttach', {autoAttach: true, waitForDebuggerOnStart: false, flatten: true}),
this._client.send('Performance.enable', {}),
this._client.send('Log.enable', {}),
this._client.send('Page.setInterceptFileChooserDialog', {enabled: true}),
]);
}
@ -160,6 +159,9 @@ class Page extends EventEmitter {
* @return !Promise<!FileChooser>}
*/
async waitForFileChooser(options = {}) {
if (!this._fileChooserInterceptors.size)
await this._client.send('Page.setInterceptFileChooserDialog', {enabled: true});
const {
timeout = this._timeoutSettings.timeout(),
} = options;