Closed gkerenyi closed 1 month ago
Thanks for reporting. This is a feature request same as #1902, we've tracked.
@Master-Ukulele Thank you, but I think this issue and #1902 are not the same, because #1902 is about disabling the harmful file warning entirely, while this one is about harmful file warning behaving inconsistently. I do not want to disable the warning, but expect it to behave the same way regardless of being subscribed to DownloadStarting
or not.
We have been working on this scenario for some time. Although there's no final conclusion yet, mostly, the reason behind to prompt the warning UI and a possible block in DownloadStarting event is the same. We consider yours as the same, because we are seeking a good solution can benefit more cases.
@gkerenyi Thanks for telling the details. To your request, I see you don't like the inconsistent behavior, but that's by design. As I know, another inconsistence is based on user's history and reaction to the warning UI. Besides disabling the warning, our draft solution probably can provide you a way to have your own warning UI, your own sentence. So, you don't need to depend on the default behavior. Will it help in your App? Please keep following the scenario discussion, we'll update if any progress comes.
Yes, having a way to override the default behavior would probably help in our use case. Thanks!
What happened?
Summary
If Smart Screen is disabled, and the user downloads a potentially harmful file (e.g. msixbundle), the displayed message depends on whether a handler is subscribed to the
DownloadStarting
WebView2 event:"File was blocked" message is shown if the client app is subscribed to
DownloadStarting
."Do you want to keep it?" question is shown if the client app is not subscribed to
DownloadStarting
.Impact on our application
In our application we have to disable Smart Screen and have to handle the
DownloadStarting
event. The "file was blocked" message displayed to our users is too strict and we would like to use the "Do you want to keep it?" question instead, because in that case the possible choices are more accessible to users.Importance
Important. My app's user experience is significantly compromised.
Runtime Channel
Stable release (WebView2 Runtime)
Runtime Version
125.0.2535.79
SDK Version
1.0.2535.41
Framework
WPF
Operating System
Windows 10, Windows 11
OS Version
No response
Repro steps
Sample repo URL: https://github.com/gkerenyi/WebView2SamplesForDownloadTest.
It is a fork of https://github.com/MicrosoftEdge/WebView2Samples with the following changes:
MainWindow.InitializeWebView()
is extended with this line to disable Smart Screen.WebViewSettings.IsReputationCheckingRequired = false;
MainWindow.InitializeWebView()
is extended with this line to add a handler to theDownloadStarting
event:webView.CoreWebView2.DownloadStarting += WebView_DownloadStarting;
WebView_DownloadStarting
handler method has an empty implementation.Steps to reproduce When subscribed to DownloadStarting
When not subscribed to DownloadStarting
MainWindow.InitializeWebView()
:webView.CoreWebView2.DownloadStarting += WebView_DownloadStarting;
Expected "Do you want to keep it?" message is shown in both cases.
Repros in Edge Browser
No, issue does not reproduce in the corresponding Edge version
Regression
Don't know
Last working version (if regression)
No response