-
-
Notifications
You must be signed in to change notification settings - Fork 22
Try opening redirect link automatically on native app #434
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
base: main
Are you sure you want to change the base?
Conversation
I don't agree with your statement that this change will be invisible for non app users, Safari will for instance show this message now to users: If we want to do this, we will first have to check if the url scheme is registered. Another option could be to add a new button that will (try to) open the link in the app. |
@bramkragten Thanks for your feedback! About using creating a new button, before creating this commit, I made another commit in another branch with this idea and also with the code from this pr, but I don't remember why I didn't continue that way. Maybe I wanted to avoid modifying the UI. |
I'm coming back to this concept, because the addition of a button maybe is too traumatic. So I added a condition where the redirect link is opened automatically only if the user agent is Windows, that way we avoid the Safari issue and other potential issues with other OS. |
@@ -56,6 +62,12 @@ const render = (showTroubleshooting: boolean) => { | |||
return; | |||
} | |||
|
|||
if (!isMobile && navigator.userAgent.includes("Windows")) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I do like this idea, but agree with Bram that the user should never aware of this.
Just allowing it for Windows is ok. But prefer if we could also allow it for Chromium browsers on Mac, but that can be in a subsequent PR.
I will ask a Windows users to verify the behavior and then this can be merged. Definitely better than another button.
Triggering CI to get a preview build |
URL to try it is here https://deploy-preview-434--my-home-assistant.netlify.app/redirect/supervisor_store/ |
This is giving an error on Firefox and so that should be filtered out. Instead of filtering by Operating System, we have to find the browsers that work. |
I checked it with Jorg, and it seems like it is a edge case issue |
Currently there is no way to open redirect links at the Home Assistant app at Windows because WSA doesn't register the app web link (and even if it did, web browsers at Windows doesn't open links on apps unless they are PWAs...).
This modifications will try to open the redirect link directly on the app (except if
mobile
is set to1
) and is completely invisible for users that doesn't have the app installed.