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

CoreWebView2NavigationKind additional types #3682

Open
JasonHeGit opened this issue Aug 3, 2023 · 2 comments
Open

CoreWebView2NavigationKind additional types #3682

JasonHeGit opened this issue Aug 3, 2023 · 2 comments
Assignees
Labels
feature request feature request tracked We are tracking this work internally.

Comments

@JasonHeGit
Copy link

JasonHeGit commented Aug 3, 2023

Is your feature request related to a problem? Please describe.
In our CEF build, when navigation is requested, if the cef_transition_type_t is TT_LINK, we cancel navigation and may open the link in the user's default browser instead.
I am trying to copy the same functionality in our WebView2 build in our NavigationStarting event handler. However, I am unable to discern whether the navigation is due to a link click, form submission, script, API call, etc. We really only want to perform this logic on link clicks only.
The recently added CoreWebView2NavigationKind appears to be the CEF equivalent, but is missing types we need, specifically the TT_LINK type.

Describe the solution you'd like and alternatives you've considered
Please add additional types from CEF like TT_LINK to the CoreWebView2NavigationKind enum.

Thanks!

AB#45823429

@JasonHeGit JasonHeGit added the feature request feature request label Aug 3, 2023
@novac42 novac42 added the tracked We are tracking this work internally. label Aug 3, 2023
@novac42 novac42 self-assigned this Aug 3, 2023
@novac42
Copy link
Contributor

novac42 commented Aug 3, 2023

Thanks for reaching out. If possible could you please shed some light on what kind of app you are building and example scenario where you need to cancel navigation and open link in default browser?

@JasonHeGit
Copy link
Author

JasonHeGit commented Aug 3, 2023

Thanks for reaching out. If possible could you please shed some light on what kind of app you are building and example scenario where you need to cancel navigation and open link in default browser?

Our app uses WebView2 controls for multiple different purposes
To

  1. View PDF files
  2. View local html files
  3. View an online payment processing page
    and so on...

Any of the above may contain links. We sometimes want to open these links in a new window or in the user's default browser.
For example, when viewing a PDF, we don't want the user to navigate away from the PDF via a link. Or when navigating to a third party website that requires a login, it may be preferred for the login to be done in the user's browser.

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

No branches or pull requests

3 participants