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

Links opening applications are not working o #1491

Open
3 tasks done
dza35013 opened this issue Aug 15, 2024 · 1 comment
Open
3 tasks done

Links opening applications are not working o #1491

dza35013 opened this issue Aug 15, 2024 · 1 comment
Labels
bug Something isn't working

Comments

@dza35013
Copy link

Checklist

  • I've searched for existing GitHub issues and I saw some issues are already reporting it but I am adding additional details
  • I have make sure that I have last versions of telegram and IOS
  • I tried all the ways to open a link in javascript such as location.href=, window.open with _self, _parent, _blank, href on an element, location= or location.replace.

Description

I am using javascript and I want to redirect the user on another system application, so here is my code:
window
.open(
"https://redirect-url-there.com",
"_parent"
)
?.focus?.();
This code is working on android version but the thing is, on IOS, it works only if I add it in onclick without any intermediate function.
For example, when I call it like 1s after the button click it doesn't redirect, which is a really strange bug ? It's maybe an issue with async functions that call a redirect or something ? But it really seems that if the redirect isn't called right after the click it won't go to the system application.
It doesn't do it on android version or in any other real browser.
Also I think, if it's like 1s later, I see the loading bar that begin and go to like 1/4 and then it doesn't do anything or sometimes I see that it goes to the target site and then go back to the original one without any reason and without redirecting the user.
Note that the apps I tried with is MetaMask.

Expected Behavior

It should redirect the user

Actual Behavior

Tell us what happens instead

Steps to Reproduce

  1. Make an html page with this code set in onclick function of any button
  2. In the same html page set also the same but that call it 1s later for example with creating an async function and include "await new Promise((resolve) => setTimeout(resolve, 1000));" at the start of the function
  3. Try both buttons and see the error

Environment

Device: iPhone

iOS version: last

App version: last

@dza35013 dza35013 added the bug Something isn't working label Aug 15, 2024
@dza35013
Copy link
Author

There is another condition than the 1s that I just found, if I edit page html just a bit it won't work, but if it stays the same it will work.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant