Javascript/jquery: how to detect page loaded in other window or with applinks?

I’m integrating a new payment method in my webpage. This method use a webredirect to … Read more Javascript/jquery: how to detect page loaded in other window or with applinks?

I’m integrating a new payment method in my webpage.
This method use a webredirect to send the customer to the payment page.

The redirect is made using location.href=.... command, then usually my web page is unloaded and user is sent to payment site.

I have some issue when the link is somehow opened in other window or if the customer is browsing with a phone, when the link is handled by the app link and the payment app is opened.
The customer completes the payment in the second window or in the mobile app and then he focus again in my webpage, but my webpage is still because for its logic, the location.href was thrown.

I know I have somehow to handle an auto-refresh when the user comes back.
How can I understand if the location.href command has unload the page or if it is just opened by an application and my page is still there?

Source: JavaSript – Stack Overflow



Leave a Reply

Your email address will not be published. Required fields are marked *