Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to disable download protection #1902

Open
viethuyphan opened this issue Nov 3, 2021 · 9 comments
Open

How to disable download protection #1902

viethuyphan opened this issue Nov 3, 2021 · 9 comments
Assignees
Labels
feature request feature request tracked We are tracking this work internally.

Comments

@viethuyphan
Copy link

viethuyphan commented Nov 3, 2021

Hi there,

I'm using WPF Webview2 to render webpages. I would like to disable download protection feature in order to not show warning dialog when I download a harmful file (.eml file in my case).
I tried to add some additional browser arguments as bellow but it didn't work, the warning dialog is still displayed:
--disable-features=msSmartScreenProtection
--safebrowsing-disable-download-protection
--safebrowsing-disable-extension-blacklist

var coreViewOptions = new CoreWebView2EnvironmentOptions(
                "--disable-features=msSmartScreenProtection --safebrowsing-disable-download-protection --safebrowsing-disable-extension-blacklist", "de");

var webView2Environment = await CoreWebView2Environment.CreateAsync(null, null, coreViewOptions);

await webView.EnsureCoreWebView2Async(webView2Environment);

image

Are there any missing arguments? Or
Are there any other ways to disable download protection?

Thanks,
Huy

AB#36984714

@champnic
Copy link
Member

champnic commented Nov 5, 2021

Hey @viethuyphan - would you mind sharing a screenshot of the download protection dialog you are referencing?

@champnic champnic self-assigned this Nov 5, 2021
@viethuyphan
Copy link
Author

viethuyphan commented Nov 8, 2021

Hi @champnic,

Here it is. Sorry for my mistake. It should be attached into the original post.

image

Hope it helps,
Huy

@champnic
Copy link
Member

champnic commented Nov 8, 2021

Thanks @viethuyphan for the clarification! Looks like that "harmful" detection is separate from SmartScreen. I haven't found a way or flag to turn it off.

If you are ok with hiding the UI altogether you can handle the DownloadStarting event.
https://docs.microsoft.com/en-us/dotnet/api/microsoft.web.webview2.core.corewebview2.downloadstarting?view=webview2-dotnet-1.0.1056-prerelease

Otherwise, would you want me to open this as a feature request?

@viethuyphan
Copy link
Author

Hi @champnic ,

Thanks for your suggestion. Yes, please open this as a feature request. I think it will be useful not only for me but also others.

Regards,
Huy

@sono-T
Copy link

sono-T commented Nov 9, 2021

Thanks @viethuyphan for the clarification! Looks like that "harmful" detection is separate from SmartScreen. I haven't found a way or flag to turn it off.

If you are ok with hiding the UI altogether you can handle the DownloadStarting event. https://docs.microsoft.com/en-us/dotnet/api/microsoft.web.webview2.core.corewebview2.downloadstarting?view=webview2-dotnet-1.0.1056-prerelease

Otherwise, would you want me to open this as a feature request?

Hi @champnic,

Yes please open the feature request for it, I need it as well.

Thanks,
Tho

@vhphuocvo
Copy link

Thanks @viethuyphan for the clarification! Looks like that "harmful" detection is separate from SmartScreen. I haven't found a way or flag to turn it off.

If you are ok with hiding the UI altogether you can handle the DownloadStarting event. https://docs.microsoft.com/en-us/dotnet/api/microsoft.web.webview2.core.corewebview2.downloadstarting?view=webview2-dotnet-1.0.1056-prerelease

Otherwise, would you want me to open this as a feature request?

Hello @champnic ,

Yes please help to create this as a feature request asap, this's crictical for user when using WebView2, i also have the same problem with this protection dialog and can't work around to disable it.

Thanks
Phuoc

@champnic champnic added feature request feature request tracked We are tracking this work internally. and removed question labels Nov 9, 2021
@champnic
Copy link
Member

champnic commented Nov 9, 2021

Thanks for the feedback - I've opened this as a scenario on our backlog!

@viethuyphan
Copy link
Author

@champnic Do you have any updates on this topic?

@nishitha-burman
Copy link
Collaborator

Hi @viethuyphan, @sono-T, and @vhphuocvo, are there scenarios where you would like this dialog enabled?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature request feature request tracked We are tracking this work internally.
Projects
None yet
Development

No branches or pull requests

5 participants