-
Notifications
You must be signed in to change notification settings - Fork 65
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
Allow Photino applications to open links in external browser #113
Conversation
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
|
Thanks for the suggestion @Jinjinov! I've only tested this change on Linux and it looks like |
I didn't have the time to check it on every OS, but I got it from here: https://stackoverflow.com/a/43232486 and I left out |
I tested your code, but unfortunately clicking on Since I am making a Markdown app, I want the links in the user's Markdown notes to be clickable. I am generating the Markdown with https://github.com/xoofx/markdig and changing the generation of |
Yes, the
Not ideal, I know, but it works for now. |
Interesting workaround, thank you for sharing :) But my core Blazor code is shared between several project: I would have to change the method that is using Markdig to work differently for Photino. |
I don't know why, but in my app, EDIT: because I am developing on Windows:
It seems like that your solution works on Linux and Mac, but not on Windows. I looked at the call stack and the call is coming from I guess that a solution that would work on every OS would have to be implemented in both https://github.com/tryphotino/photino.Native and https://github.com/tryphotino/photino.NET
|
I'm not quite sold on this solution tbh. It is confusing to have to use the |
Thanks @philippjbauer , that does indeed sound like a better solution and I agree that it shouldn't be merged in as is. I'll try your suggestion and let you guys know if it works. |
I apologize for the off-topic comment, but this solution might help someone else who wants to open Markdown links in the default browser:
|
@andrew-bedford Looking forward to a new pull request. We're going to close this one for now. When you create the new pull request, please do it against the debug branch as we never merge directly into master. Thank you! |
This commit provides a workaround for issue #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 contain0.0.0.0
orlocalhost
, then we open the link in the browser.Partially resolves #111