1

I have a site embedded in an iframe from where I want to launch a mobile app. The following is bound to an onClick action on my button, and works in both Chrome and Firefox on my Android:

window.location = "scheme://app.com/?action=xxxxx"

However, when trying on Safari on iOS, nothing happens at all when clicking the button. If i go to the site directly (instead of iframing it) it works perfectly.

The same thing happens if I use an anchor tag:

<a href="scheme://app.com?action=xxxxx"></a>

I tried to fix this by using window.top.location, but then I run into Same-origin policy issues. The site that is hosting the iframe is on a different domain which I can't control.

Is there a workaround for this?

Boxiom
  • 2,245
  • 6
  • 40
  • 51

0 Answers0