Closed Jinjinov closed 1 week ago
I'm facing the same issue, except that any link with a target
won't open, not even in the same window. I've also tried using onclick="window.open..."
, but no luck.
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
fire up an external browser
or
spin up a new process in C#
I am asking to intercept the <a href>
click, which I believe is within the scope of this library.
It is also something that is supported in
class BlazorWebView
in namespace Microsoft.AspNetCore.Components.WebView.Wpf
class BlazorWebView
in namespace Microsoft.AspNetCore.Components.WebView.WindowsForms
class BlazorWebView
in namespace Microsoft.AspNetCore.Components.WebView.Maui
with blazorWebView.UrlLoading += OnUrlLoading;
So I think that my request is not unreasonable. This feature could be used for many things beside spinning up a new process.
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 wrapMicrosoft.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.