7

I have what seems like a stupid problem. I have been working on a WebView2 app for a couple of days now. Prior to today, when I would download a file within the app, I would get the usual download notification box in the lower left. Now I'm getting this popup window on the upper right. I don't know what has changed. I've gone back to old code in which I didn't see this behavior and it does it there also. I need to move it back to the lower left. Does anyone know what I have done or how to change this back? Thanks for any help. Kevin.

enter image description here

2 Answers 2

4

I suggest you take full control of the dialog (I don't think you can easily just move it).

You do that by subscribing to the CoreWebView2.DownloadStarting event: CoreWebView2.DownloadStarting.

The CoreWebView2DownloadStartingEventArgs has a property DownloadOperation (see CoreWebView2DownloadOperation giving you access to the progress.

Here you can totally define, what should happen, in your case showing a progress dialog.

To see an example of this, you can check my answer HERE

1
  • 2
    Thanks, this led me to what I needed. I found the Handled property in the CoreWebVFiew2DownloadStartingEventArgs. This lets me remove the default download notification entirely. I'm already tapping into the DownloadOperation StateChanged event to do some custom handling of the file that is downloaded so this fits right in.
    – KevinV
    Commented Aug 18, 2021 at 13:44
2

The Edge browser and the WebView2 Runtime updated the download UX to what you see now. The WebView2 release notes note this happened near July 26, 2021.

The download UX is implemented in the WebView2 Runtime. If you have an older Fixed Version copy of the WebView2 Runtime you would be able to see the old download UX. Changing the WebView2 SDK version will not change which download UX you get.

This is the default download UX for WebView2. You can replace it with your own custom download UX using the CoreWebView2.DownloadStarting event and associated APIs.

3
  • I was coming to the conclusion the cause was some kind of underlying update outside of my code. Thanks for the confirmation.
    – KevinV
    Commented Aug 18, 2021 at 13:45
  • Can we switch off this window from showing all together? Commented Mar 7, 2023 at 12:05
  • Yes, CoreWebView2DownloadStartingEventArgs.Handled set to true will turn off the default download UX. Its the first step in doing custom UX, turn off the default and then show your own. Commented Mar 7, 2023 at 17:41

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.