0

It's all in the title.

I Tried EVERY possible way. I tried the InAppBrowser plugin, but whatever I do. It always opens in my app instead of in Safari. There is nothing wrong with this code I think?

window.open(encodeURI('http://XXX.XXX.XXX.XXX/linkylink/'+ variable.link), "_system",'location=no');

Also if i change location to yes. I dont see any changes (no location bar)

Nick
  • 575
  • 10
  • 29
  • Why are you using encodeURI? – ceejayoz Jun 04 '15 at 21:40
  • Make sure you have inAppBrowser installed `cordova plugin list`. I also notice that if you are trying this on an anchor tag (for example you only want it to open in inAppBrowser on certain platforms or something) make sure you prevent the default event: `evt.preventDefault(); window.open(encodeURI($(this).attr('href')), '_system');` – laughingpine Jun 04 '15 at 21:44
  • @ceejayoz why shouldn't I? – Nick Jun 05 '15 at 00:22
  • @laughingpine The inappBrowser is installed. I do this in straight javascript(after taking a picture, open url). Don't have anchor tags. I want to do this on every platform (on android it works fine) – Nick Jun 05 '15 at 00:22
  • Not sure it is related, but try to set `OpenAllWhitelistURLsInWebView` to `No` in `cordova.plist`. Check this [SO question](http://stackoverflow.com/questions/10244965/phonegap-opening-external-urls-in-safari) for more information on this. – Guillem Vicens Jun 05 '15 at 07:30

1 Answers1

0

The plugin wasn't loaded correctly. Reinstalled plugin and it works :)

Nick
  • 575
  • 10
  • 29