I know how to subscribe to the CoreWebview2.DownloadStarting event and use handled = true to stop the Download dialog from showing while a download (i.e. an image) is being made, but the problem is the DownloadStarting event never fires if you right click on a web page and choose "Save as" or "Print > Save as PDF", even though the Download dialog will appear as if a regular download was being made. Does anyone know any workaround for this?
As the previous posters said, there is the IsDefaultDownloadDialogOpenChanged event, of the CoreWebView2 class. But instead of explictly closing the dialog "manually", by using the CloseDefaultDownloadDialog() method, you can set e.Handled = true in the event handler, to prevent WebView2 from displaying the dialog.
But the even better approach is to not do this in the IsDefaultDownloadDialogOpenChanged event, but instead in the DownloadStarting event, of the CoreWebView2 class. It works exactly the same and e.Handled = true in the event handler prevents WebView2 from displaying the dialog at all.
The control is wrapped in a Grid in the code below because I noticed that if I put the webview in a StackPanel, then the webview doesn't show (no height/width measurements given) but the flyout does appear in front as expected. So I tried DockPanel and Grid which show the webview page but hide the flyout.
Yep: I have the exact same problem with MahApps Metro async dialogs displaying underneath. Menus and Context Menus work fine although the latter isn't styled like the former which is a real bummer and headache to do.
I'll try styling the Context Menu but the answer is that I am seriously thinking of just doing all of the menus and dialogs in JavaScript leaving just the WebView2 plus Mahapps shell with an Hamburger icon which I did get working. As I can always just use JS to C# interop to do processing with C# libraries in the effective back end in which I case I could go with Photino but then I wouldn't be able to use my Hamburger icon in the MetroWindow Title Bar so I will stick with it. Decisions. Decisions..
This is the definitive answer to use of WebView2: menus, context menus, or else JavaScript menus and dialogs for everything. Although I am pretty sure regular Windows popup dialogs or custom ones in their own windows will work but again you will have to style them and I am beginning to think that styling in JS and CSS will be one hell of a lot easier!
The host can choose to cancel a download, change the result file path, and hide the default download dialog. If download is not handled or canceled, the download is saved to the default path after the event completes with default download dialog shown.
I don't know what this will eventually be used for but it keeps getting installed and I have to uninstall it as it causes Edge, stable, dev, and canary, to become unusable. Pages load slow and hang while my CPU starts chugging. It's been like this since last week when I discovered Canary had introduced Vertical Tab and the ability to hide the Title Bar. In my troubleshooting, I went so far as to completely remove all Edge chromium from my machine and start fresh.
I am testing by going into our main Docking / MDI demo by clicking the button at the top of the first Sample Browser page. Then I select "Options / Use Hosted Popups" to uncheck it. I auto-hide tool windows on all sides and maximized the Window. All popups show where they are expected to for me. I tried on multiple monitors.
I have a hidden download dialog in my application. Webview2 sometimes (irregularly) does not complete the download of a small (40-70kb) Pdf file - its final renaming does not occur. The application seems to be in a waiting state, but it is not stopping nor not sleeping. The file remains in the Download folder in the form .tmp. If I close the app, this tmp file is automatically deleted. If I copy the tmp file and rename it to xx.pdf, this file is regular and the pdf reader opens it.
Downloading the file from your example is not the slightest problem. As I already wrote - the files that the application downloads are always about 40-70kb in size. It bothers me that sometimes (irregularly) it doesn't work. Downloading the same file repeatedly is no longer a problem. Of course, after closing and restarting the application. I don't even register any exception in the log. In my opinion, this is probably some bug in the webview2 component.
Interesting thought. But the problem of why the downloaded file remains in tmp format and is "held" by the application (and is not renamed to pdf - this should be an automatic action of the webview2 component) probably does not explain this. Or am I wrong?
By default, we have got the following context menu for WebView 2 control: If you want to hide this default context menu, the following piece of code will be helpful:// add in MainWindow constructor for demo purposeswebView.CoreWebView2Initialized += WebView_CoreWebView2Initialized;private void WebView_CoreWebView2Initialized(WebView2 sender, CoreWebView2InitializedEventArgs args)webView.CoreWebView2.Settings.AreDefaultContextMenusEnabled = false;In similar way, you can hide standard alert and prompt dialogs and customize them on your own: private void WebView_CoreWebView2Initialized(WebView2 sender, CoreWebView2InitializedEventArgs args)webView.CoreWebView2.Settings.AreDefaultScriptDialogsEnabled = false;webView.CoreWebView2.ScriptDialogOpening += CoreWebView2_ScriptDialogOpening;private void CoreWebView2_ScriptDialogOpening(CoreWebView2 sender, CoreWebView2ScriptDialogOpeningEventArgs args)if (args.Kind == CoreWebView2ScriptDialogKind.Alert)// this is an alert, would you like to display it?// always press OK (not the best idea)args.Accept();Now imagine, your web page requests to create a new window, for example with window.open() and you need to add some custom processing. This is how you can do it: private void WebView_CoreWebView2Initialized(WebView2 sender, CoreWebView2InitializedEventArgs args)webView.CoreWebView2.NewWindowRequested += CoreWebView2_NewWindowRequested;private void CoreWebView2_NewWindowRequested(CoreWebView2 sender, CoreWebView2NewWindowRequestedEventArgs args)args.Handled = true;webView.Source = new Uri(args.Uri);We set here Handled property to true, telling our WebView 2 that it is not necessary to create new window any more. And then, just for demo purposes we redirect current web page to received URL.
Battery status notification and automatic keyboard pop-up dialog might not appear during the session when the Automatic keyboard display policy is enabled on the DDC. [CVADHELP-19987]
We're having the same issue on about 10% of our workstations. Double-clicking a message or a contact does not open in a new window. The users are also reporting that double-clicking a word in Outlook to highlight it also stops working. Uninstalling webview2 causes the issue to go away...until it reinstalls itself. I've discovered that if you change Outlook to online only access (no cache or ost file) it works fine also (not a permanent solution). Microsoft has been helpful in trying to solve the issue. Most recently, they instructed me to patch Outlook to Build 16501.20210, but after a few hours the problem reappeared. It only affects Outlook. Double-clicking on anything outside of Outlook continues to work fine. As a work-around the users are highlighting the message or contact in the left column then hitting "Enter", and that opens both in a new window just fine. BTW, I've already tried all the usual; create a new profile, rebuild the cache file, etc. Also, this happens on various versions of Office - 2016, 2019, 2021 and 365
5. Fixed display errors in the two-factor authentication dialog. If the terminal had several accounts with the same number but opened with different brokers, the account connection form could fail to display the one-time password field.
And if the shutdown work takes some time, users may feel that the app is exiting slowly, which is bad experience, so you could just hide the window in the close event before really closing it to make a smooth user experience.
As of release 7.70 multi-monitor scaling can be activated in the SAP GUI options dialog so that the issues with multiple monitor setups using different scaling settings are solved. The feature can be activated for Belize and Quartz themes if a sufficiently new Windows version is used via this setting:
The maximum width of a dialog box (popup) is limited by the horizontal resolution of the display. When an application inserts many buttons or wide buttons in the application toolbar (footer) of a dialog box or the resolution is low or the used font size is big, this sometimes exceeds the maximum width. In SAP GUI releases up to release 7.60, such buttons could not be displayed.
SAP GUI scripting offers a dialog for recording and replaying scripts. This dialog had several functional and usability issues. Therefore, it has been reworked in release 7.70 and the following changes were applied:
HTTP basic authentication and NTLM authentication
By default HTTP basic authentication and NTLM authentication requests inside WebView2 show the authentication UI, which is a dialog prompt in which the user can type in user name and password credentials just like in the Edge browser. We have been requested by WebView2 app developers to provide finer granularity for managing HTTP Basic/NTLM authentications inside WebView2, including the ability to hide the login UI and provide credentials.
Power BI is experiencing a problem with WebView2. We need your help to understand and fix this issue. If you are willing to help out, please contact us at pbidesktopwe...@service.microsoft.com
You can share them out at pbidesktopwe...@service.microsoft.com or if you are not sure how to go about gathering this information, reach out to pbidesktopwe...@service.microsoft.com and we can get on a call work with you to get the issue sorted.
35fe9a5643