Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
fix(filechooser): quick fix for the headful file chooser (#5369)
Fixes #5363
  • Loading branch information
pavelfeldman committed Jan 31, 2020
1 parent 1a1ef83 commit 9923e56
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion lib/Page.js
Expand Up @@ -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}),
]);
}

Expand All @@ -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;
Expand Down

3 comments on commit 9923e56

@phihag
Copy link
Contributor

@phihag phihag commented on 9923e56 Feb 5, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Excellent! This fixes a strange bug I was experiencing. Any timeline on when it will be released as a new puppeteer version?
That would likely fix #5384 .

@wardnath
Copy link

@wardnath wardnath commented on 9923e56 Feb 6, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@phihag looks like it was included in v 2.1.1 -> https://github.com/puppeteer/puppeteer/commits/v2.1.1

@phihag
Copy link
Contributor

@phihag phihag commented on 9923e56 Feb 7, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@wardnath That's great, but without #5389 , file upload is still broken, just differently.

Please sign in to comment.