Nathan Friend
Posts: 0
Joined: Fri Jan 31, 2014 3:56 pm

Open Links in Safari (iOS)/Native Browser

Ah yes, that would not be possible in your case.

Nathan Friend
Posts: 0
Joined: Fri Jan 31, 2014 3:56 pm

Open Links in Safari (iOS)/Native Browser

To create a result similar to using the Navigate to link function inside of an onclick event, use the following.

window.open(url, "_blank");

Opens the browser inside of the application window with a done button at the bottom to close the browser window.

Tested in IOS only.

Matt6607699
Posts: 0
Joined: Sat Jan 25, 2014 7:18 am

Open Links in Safari (iOS)/Native Browser

This is totally not working for me for some reason.

I am using:
window.open(URL, '_system', 'location=yes');

also tried:
window.open(URL, '_system');

The link always opens in the app browser with no way to close it or go back.
this is on the xcode ios simulator and downloaded from xcode to phone/ipad.

Illya Stepanov
Posts: 0
Joined: Mon Mar 18, 2013 8:48 am

Open Links in Safari (iOS)/Native Browser

Hi Matt - Where you want to open the link? What version of iOS you are using?

Matt6607699
Posts: 0
Joined: Sat Jan 25, 2014 7:18 am

Open Links in Safari (iOS)/Native Browser

I want to open the link in the safari browser. I've tried it on iphone ios 7.0.4 and ipad 7.0.6 with no luck. The _system target doesn't seem to work for me.

Illya Stepanov
Posts: 0
Joined: Mon Mar 18, 2013 8:48 am

Open Links in Safari (iOS)/Native Browser

Can you show how exactly you're using this code? It works for me as expected (iOS7.1).

Matt6607699
Posts: 0
Joined: Sat Jan 25, 2014 7:18 am

Open Links in Safari (iOS)/Native Browser

On a button click I have a Run Javascript event:

codevar URL = localStorage.getItem('local_connection_URL');
var Status = localStorage.getItem('connection_status');
if (Status==="connected"){
window.open(URL,"_system");
}else{
console.log("The connections has not been completed by both parties, waiting on other party");
}/code

It opens the link but it is always in the inApp browser, not safari.

I've been checking into seeing if there is something in xcode (v5.0.2) that I need to change but have been unable to find anything yet.

Illya Stepanov
Posts: 0
Joined: Mon Mar 18, 2013 8:48 am

Open Links in Safari (iOS)/Native Browser

How you define local storage variable URL?

Matt6607699
Posts: 0
Joined: Sat Jan 25, 2014 7:18 am

Open Links in Safari (iOS)/Native Browser

The URL is loaded from the database to a label in a grid ="user_url_label". When the button is clicked, I have an event that sets local storage variable: "local_connection_URL" bind to component "user_url_label".

The same is then done with "connection_status"

Then I run the JS from the previous post. The correct URL is stored and it opens the correct location when I use window.open(URL,"_system");
It just opens in the in app browser instead of safari.

Illya Stepanov
Posts: 0
Joined: Mon Mar 18, 2013 8:48 am

Open Links in Safari (iOS)/Native Browser

Are you using iframe on that page? If it possible can you give us public link to take a look?

Return to “Issues”