-
Notifications
You must be signed in to change notification settings - Fork 64
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
Intercept <a href>
navigation
#111
Comments
I'm facing the same issue, except that any link with a |
This commit provides a workaround for issue tryphotino#111. Users were not able to open links in an external browser window, only inside the WebView itself. We now intercept web requests that use the application's scheme (e.g., `app://`) and, if it does not contain `0.0.0.0` or `localhost`, then we open the link in the browser. Resolves tryphotino#111
Photino is not designed to fire up an external browser. You can spin up a new process in C# to open a browser, but spinning up a new process is not something we're looking at doing in Photino. |
What I am asking in this issue is not to
or
I am asking to intercept the It is also something that is supported in
with So I think that my request is not unreasonable. This feature could be used for many things beside spinning up a new process. |
@Jinjinov I'm confused. You said, "The default behavior of any desktop Blazor app (Photino, MAUI, WPF, WinForms) using any kind of webview is to open the link in the same webview window, but I want external links to open in the default browser." If that's not what you want to do, can you explain your use case in more detail? If you want to intercept the click on the link, you can add an event handler in JavaScript. Or you could use a custom scheme for the URL to handle the click in C#. |
I would like you to add an event UrlLoading on the main Blazor window which triggers when the user clicks on The point of Blazor is to use C# instead of JS wherever possible. Yes, I can use JS to handle clicks on But in my case the Right now I am using code that slows down the conversion from Markdown to Html to add JS to Subscribing to |
@philippjbauer Any chance that you take a look at this? Does it still deserve the "wontfix" label? |
@Jinjinov , I don't know if it will help you but I ended up simply using PyQt with a |
@andrew-bedford Thank you! My project uses Photino in just 5% of the code, the rest relies heavily on C# https://github.com/Jinjinov/OpenHabitTracker |
I have a note taking app where users can take notes containing links that get converted to
<a href>
.The default behavior of any desktop Blazor app (Photino, MAUI, WPF, WinForms) using any kind of webview is to open the link in the same webview window, but I want external links to open in the default browser.
Adding
target="_blank" rel="noopener noreferrer"
to<a href>
opens the link in a new webview window, which is not what I want.For:
Microsoft.AspNetCore.Components.WebView.Maui.BlazorWebView
Microsoft.AspNetCore.Components.WebView.Wpf.BlazorWebView
Microsoft.AspNetCore.Components.WebView.WindowsForms.BlazorWebView
which wrap
Microsoft.UI.Xaml.Controls.WebView2
Microsoft.Web.WebView2.Wpf.WebView2
Microsoft.Web.WebView2.WinForms.WebView2
it is possible to intercept
<a href>
navigation in MAUI Blazor hybrid and open it in the default browser like so:and in WPF like so:
I would like to do the same in Photino, even if only on Linux.
The text was updated successfully, but these errors were encountered: