BrowserClientSetDownloadBehaviorAsync Method |
Version 130.1.90
Set the behavior when downloading a file.
Namespace: CefSharp.DevTools.BrowserAssembly: CefSharp.Core (in CefSharp.Core.dll) Version: 129.0.110.0
Syntax public Task<DevToolsMethodResponse> SetDownloadBehaviorAsync(
SetDownloadBehaviorBehavior behavior,
string browserContextId = null,
string downloadPath = null,
bool? eventsEnabled = null
)
public:
Task<DevToolsMethodResponse^>^ SetDownloadBehaviorAsync(
SetDownloadBehaviorBehavior behavior,
String^ browserContextId = nullptr,
String^ downloadPath = nullptr,
Nullable<bool> eventsEnabled = nullptr
)
Parameters
- behavior SetDownloadBehaviorBehavior
- Whether to allow all or deny all download requests, or use default Chrome behavior ifavailable (otherwise deny). |allowAndName| allows download and names files according totheir download guids.
- browserContextId String (Optional)
- BrowserContext to set download behavior. When omitted, default browser context is used.
- downloadPath String (Optional)
- The default path to save downloaded files to. This is required if behavior is set to 'allow'or 'allowAndName'.
- eventsEnabled NullableBoolean (Optional)
- Whether to emit download events (defaults to false).
Return Value
TaskDevToolsMethodResponsereturns System.Threading.Tasks.Task<DevToolsMethodResponse>
See Also