mirror of
https://github.com/puppeteer/puppeteer
synced 2024-06-14 14:02:48 +00:00
fix(filechooser): quick fix for the headful file chooser (#5369)
Fixes #5363
This commit is contained in:
parent
1a1ef83e8d
commit
9923e56b3e
@ -135,7 +135,6 @@ class Page extends EventEmitter {
|
|||||||
this._client.send('Target.setAutoAttach', {autoAttach: true, waitForDebuggerOnStart: false, flatten: true}),
|
this._client.send('Target.setAutoAttach', {autoAttach: true, waitForDebuggerOnStart: false, flatten: true}),
|
||||||
this._client.send('Performance.enable', {}),
|
this._client.send('Performance.enable', {}),
|
||||||
this._client.send('Log.enable', {}),
|
this._client.send('Log.enable', {}),
|
||||||
this._client.send('Page.setInterceptFileChooserDialog', {enabled: true}),
|
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -160,6 +159,9 @@ class Page extends EventEmitter {
|
|||||||
* @return !Promise<!FileChooser>}
|
* @return !Promise<!FileChooser>}
|
||||||
*/
|
*/
|
||||||
async waitForFileChooser(options = {}) {
|
async waitForFileChooser(options = {}) {
|
||||||
|
if (!this._fileChooserInterceptors.size)
|
||||||
|
await this._client.send('Page.setInterceptFileChooserDialog', {enabled: true});
|
||||||
|
|
||||||
const {
|
const {
|
||||||
timeout = this._timeoutSettings.timeout(),
|
timeout = this._timeoutSettings.timeout(),
|
||||||
} = options;
|
} = options;
|
||||||
|
Loading…
Reference in New Issue
Block a user