-
Notifications
You must be signed in to change notification settings - Fork 689
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
Dragging a file from Explorer over top of a WebView2 in the application window will launch another process #9650
Comments
Hi I'm an AI powered bot that finds similar issues based off the issue title. Please view the issues below to see if they solve your problem, and if the issue describes your problem please consider closing this one. Thank you! Closed similar issues:
|
If it helps, it seems like it may be EmbeddedBrowserWebView!base::LaunchProcess that is making the call to CreateProcess that results in the default extension handler in windows launching based on the extension.
|
Looks like this is the last version that doesn't reproduce the issue
|
Curious as to why this regression is being closed as not planned? This is a major accessibility feature for our app that is widely used by CSS and not fixing this regression will result in us being unable to update to latest WebView. |
@jschick04 apologies. I mistook your last comment that this was fixed in the last release. Could you provide a simple repro project for this in WinUI3 if possible (not MAUI) ?. EmbeddedBrowserWebview.dll is not part of WinUI. Let me follow up to find more. |
I will see if I can repro this with a WinUI project. My app and the repro provided above was done with Maui hybrid and I initially opened an issue with Maui and was directed to this repro (issue linked in the first comment). |
Ok, I was able to reproduce the issue by creating a WinUI3 project and adding the following to MainWindow.xaml
Inside of MainWindow.xaml.cs I replace MainWindow constructor with the following and add the OnDragOver function to allow the copy operation.
Running the application will show the double icons as shown in the initial post. This scenario doesn't launch the default extension handler but will launch a separate window with a prompt to download the file that I drag over the application. |
There is an API to intercept the new window creation – have you tried using that to see if you can achieve the experience you want? The code below works for me. It automatically downloads the file without asking for consent, but I assume that can be added in the code below if needed.
|
Using the NewWindowRequested callback and just setting I will need to see how I can adapt this to Maui Hybrid to see if it works around the issue there and to see how this interacts with the addition of the drag handlers on the web side of things. This was another issue that I ran into is the WebView2 drag/drop functionality did not play well with Blazor Hybrid but that is another issue for when we can go back to using the most recent version of WebView2. Ideally it seems that WebView2 should respect the drag/drop handlers from the XAML side or XAML should defer to WebView2 if that is where the drag/drop functionality is going to have to be configured. Or maybe a global option to configure XAML or WebView2 as the default handler for drag/drop, especially since it looks like the addition of drag/drop functionality from WebView2 is where this all started. |
Looks like this workaround isn't viable for Maui or at least I cannot find the NewWindowRequested callback for how this is implemented with Maui Hybrid. |
Describe the bug
I am working on a project that is basically an alternative to the Event Viewer MMC snap-in where we load evtx files and parse and display those events. Recently, I have noticed that dragging and dropping a .evtx files onto the application window is now launching an additional application process. If go into settings and change the .evtx extension default handler back to the Event View MMC then dragging and dropping a file onto the window will launch the Event Viewer MMC snap-in.
There have been no code changes to how we handle OnDrop or OnDragging and I have not been able to pinpoint any specific change around when this issue started. If I install a previous version of the app before the issue started then it does not repro but if I roll back to the commit tied to that release then I can reproduce the issue again. I have also tested previous .NET SDK versions with no success.
My suspicion is that it may be tied to the fix for the following issue that was recently resolved but do not have any hard evidence against this right now.
#7366
I have been able to reproduce this issue on a clean MAUI Hybrid project in VS 17.9.
Initially filed this over on the Maui repo but was recommended to bring this issue over here.
dotnet/maui#22556
Steps to reproduce the bug
Release the mouse button and the default application for the extension of the file being dragged will be launched. In the case of the above screen shot, dragging a .PML file over the window and releasing will launch procmon
Expected behavior
App should be able to handle this file via OnDrop and no other applications should be launched
Screenshots
No response
NuGet package version
None
Windows version
Windows 11 (22H2): Build 22621
Additional context
No response
The text was updated successfully, but these errors were encountered: