-
Notifications
You must be signed in to change notification settings - Fork 53
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
Failed to disable new tab/window popup on Ctrl/Shift + Click, Ctrl/Shift + Enter or Mid wheel click by link/button #2652
Comments
Winforms or wpf? I haven't been able to reproduce this unless I am trying it on the wrong sort of page |
It's WPF.
Below is a sketch of form script we use (clicking by 'Sign in' with holding Ctrl/Shift will go different way if we redirect new window request to the current window or let it run in the new one):
|
Ok I retest on my end and indeed I can reproduce this and also try control A to select all and control C to copy.... |
Hi, sorry for the delay, this has fallen off my radar while I was on vacation. Unfortunately, setting the opener WebView as NewWindow may cause some unexpected behavior as internally what is happening is the opener WebView's content is closed and replaced with the opened content. I added this to our bug backlog to investigate this behavior. In the meantime, have you tried handling the Ctrl presses via AcceleratorKeyPressed event to prevent it being processed via WebView2? |
This is fixed in runtimes 109.0.1496.0+. Thanks! |
Version: 1.0.1264.42
We use web login form in our WPF app and we need to prevent browser to open new tab/window on Ctrl/Shift + Click, Ctrl/Shift + Enter or Mid wheel click by link/button.
We failed to disable that behavior with
CoreWebView2.Settings.AreBrowserAcceleratorKeysEnabled = false
We tried to redirect new window request to current window with
CoreWebView2.NewWindowRequested += (s, a) => a.NewWindow = (CoreWebView2)s;
, but we got different behavior on form submit button:AB#41353848
The text was updated successfully, but these errors were encountered: