Browser.setDownloadBehavior doesn't work for WebView2


I receive invalid argument error (0x80070057 e_invalidarg)  when I use CallDevToolsProtocolMethod with Browser.setDownloadBehavior as command and L"{\"behavior\":\"deny\"}" as parameters:


const wchar_t* command = L"Browser.setDownloadBehavior";
const wchar_t* parameters = L"{\"behavior\":\"deny\"}";
HRESULT res = webview->CallDevToolsProtocolMethod(command,
[this](HRESULT error, PCWSTR resultJson) -> HRESULT
std::wstringstream formattedMessage;
formattedMessage << "Error: 0x" << std::hex << std::setw(8) << error;
std::wstring str = formattedMessage.str();
return S_OK;


Other Chrome Dev Tool Protocol methods works fine.


Browser.setDownloadBehavior works when I start it in Dev Tools Window:

await Main.MainImpl.sendOverProtocol("Browser.setDownloadBehavior", {
behavior: "deny"


Is this a known issue or I am doing something wrong?


WebView2 version: 0.9.579

Edge Beta version: 86.0.622.15  

0 Replies