← Back to Page domain

Page.setDownloadBehavior

Set the behavior when downloading a file.

Domain: Page deprecated

Parameters

NameTypeDescription
behaviorstringWhether to allow all or deny all download requests, or use default Chrome behavior if available (otherwise deny).
downloadPath (optional)stringThe default path to save downloaded files to. This is required if behavior is set to 'allow'

Example Request

{
  "id": 1,
  "method": "Page.setDownloadBehavior",
  "params": {
    "behavior": "behavior-value"
  }
}

Example Response

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

Usage in Node.js

const result = await send('Page.setDownloadBehavior', {"behavior": "behavior-value"});
console.log(result);