Browser.setDownloadBehaviorSet the behavior when downloading a file.
| Name | Type | Description |
|---|---|---|
behavior | string | Whether to allow all or deny all download requests, or use default Chrome behavior if available (otherwise deny). |allowAndName| allows download and names files according to their download guids. |
browserContextId (optional) | BrowserContextID | BrowserContext to set download behavior. When omitted, default browser context is used. |
downloadPath (optional) | string | The default path to save downloaded files to. This is required if behavior is set to 'allow' or 'allowAndName'. |
eventsEnabled (optional) | boolean | Whether to emit download events (defaults to false). |
{
"id": 1,
"method": "Browser.setDownloadBehavior",
"params": {
"behavior": "behavior-value"
}
}
{
"id": 1,
"result": {}
}
const result = await send('Browser.setDownloadBehavior', {"behavior": "behavior-value"});
console.log(result);