Skip to content
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

WinForms WebView2 - how to handle Ctrl+Click on a link #371

Closed
joergbattermann opened this issue Aug 6, 2020 · 6 comments
Closed

WinForms WebView2 - how to handle Ctrl+Click on a link #371

joergbattermann opened this issue Aug 6, 2020 · 6 comments
Labels
feature request feature request

Comments

@joergbattermann
Copy link

joergbattermann commented Aug 6, 2020

I can register an event handler for the WinForms webView2 UserControl's .CoreWebview2.NewWindowRequested event and that event gets raised whenever I right click > and then select/click > 'Open in new Tab' in the context menu, however NOT when I hold the [Ctrl] key + left click a link. The later opens an entirely new browser window outside my application's context / control.

How can I handle both - new window- AND new tab requests?

Thanks!
-J

AB#28262280

@pagoe-msft
Copy link

@joergbattermann ,

Thanks for pointing this out! This is a known issue caused by a change in the web platform behavior. Previously, a new tab would replace the content in the WebView, now it opens a new window. We are exploring creating a NewTabRequested Event or also firing the NewWindowRequested Event

@pagoe-msft pagoe-msft added the feature request feature request label Aug 7, 2020
@joergbattermann
Copy link
Author

Thanks for the clarification @pagoe-msft! 👍 Either one of the solution(s) would be fine for me, as long as I can differentiate between new window and new tab requests.

Hope this makes it into one of the next releases 🤞

@ukandrewc
Copy link

On NewWindowRequested, any plans to provide settings from window.open, so we can set size, etc?

@pagoe-msft
Copy link

@ukandrewc - I'll add that to our backlog as well! Do you mind creating a separate GH issue?

@pagoe-msft
Copy link

Hi Everyone,

This was addressed in the 1.0.707-prerelease version.

@clairernovotny
Copy link

I don't see a way to tell the difference to tell if the user did a ctrl+click or not?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature request feature request
Projects
None yet
Development

No branches or pull requests

4 participants