Browser.setDownloadBehavior doesn't work for WebView2

Visitor

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,
parameters,
Callback<ICoreWebView2CallDevToolsProtocolMethodCompletedHandler>(
[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;
}).Get());

 

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