Module

x/puppeteer/mod.ts>FileChooser

A port of puppeteer running on Deno
Latest
class FileChooser
import { FileChooser } from "https://dotland.deno.dev/x/puppeteer@16.2.0/mod.ts";

File choosers let you react to the page requesting for a file.

Examples

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.

import FileChooser
import { FileChooser } from "https://dotland.deno.dev/x/puppeteer@16.2.0/mod.ts";