← Back to Page domain

Page.setInterceptFileChooserDialog

Intercept file chooser requests and transfer control to protocol clients. When file chooser interception is enabled, native file chooser dialog is not shown. Instead, a protocol event `Page.fileChooserOpened` is emitted.

Domain: Page stable

Parameters

NameTypeDescription
enabledboolean
cancel (optional)booleanIf true, cancels the dialog by emitting relevant events (if any) in addition to not showing it if the interception is enabled (default: false).

Example Request

{
  "id": 1,
  "method": "Page.setInterceptFileChooserDialog",
  "params": {
    "enabled": true
  }
}

Example Response

{
  "id": 1,
  "result": {}
}

Usage in Node.js

const result = await send('Page.setInterceptFileChooserDialog', {"enabled": true});
console.log(result);