import { FileChooser } from "https://deno.land/x/frugal@0.9.6/dep/puppeteer/mod.ts";
File choosers let you react to the page requesting for a file.
Examples
Example 1
Example 1
const [fileChooser] = await Promise.all([
page.waitForFileChooser(),
page.click('#upload-file-button'), // some button that triggers file selection
]);
await fileChooser.accept(['/tmp/myfile.pdf']);
Constructors
new
FileChooser(element: ElementHandle<any>, event: Protocol.Page.FileChooserOpenedEvent)Methods
accept(filePaths: string[]): Promise<void>
Accept the file chooser request with given paths.
cancel(): void
Closes the file chooser without selecting any files.
isMultiple(): boolean
Whether file chooser allow for multiple file selection.