Link opens a new browser in spite of

hey guys,

Something weird happened to my hype document in an iframe within an app on a mobile phone.
I put an action in a button to take users to another hype document. I did not put a tick in the tick box for “open a new window”. But when I click on the button, it takes me out of the app and opened a web browser. This behaviour is unexpected. I assume if you don’t tick “in a new window” it will target _self.

Why is this happening. And how do I fix this?

I suspect that you are using a go to url action.
And possibly the mobile devices os helpers are picking up the call.

One possible work around is to have the button call a function.

The function does either a location change or a window.open() with a construction to open in self.

1 Like

If Open in a new window is unchecked for the Go to URL action, Hype uses window.top.location = url; under-the-hood, which is probably resulting in that action depending on how the app is setup. In most situations we found users do intend to want to replace the entire window location, hence top.

Like @MarkHunte recommended, instead you can use a Run JavaScript… action with window.open() and specify the target to see if that works.

1 Like

Thanks guys. I’ll have a go

1 Like