Open ANY EXISTING LINK on system browser

  • 2
  • Question
  • Updated 7 years ago
  • Doesn't Need an Answer
I would like to know how to order to PhoneGap to open ANY EXISTING LINK in the system web browser.

This is not working: < preference name="stay-in-webview" value="false" />

Solutions like

navigator.app.loadUrl('http://www.google.com', { openExternal:true } );
or
window.open('http://www.myurl.nl', '_blank', 'location=yes');

are no aceptable, because there are are some times that you fetch data from an api and there in the text exists links and you can not controlo or modify the content

Thant you very much
Photo of yeradis

yeradis

  • 5 Posts
  • 0 Reply Likes
  • sad

Posted 7 years ago

  • 2
Photo of Giuseppe

Giuseppe

  • 2 Posts
  • 0 Reply Likes
I'm in the same situation.

I have an application developed in Wavemaker, thath retrieves json from a REST API with some HTML content I show on a HTMl widget, and I need all this links retrieved to be opened outside application on system browser, mainly due to inside app is very very slow to open, and my app is locked to portrait, and links can be viewed on landscape.

Regards.
Photo of Amir

Amir

  • 8261 Posts
  • 263 Reply Likes
Should be:


window.open('http://www.myurl.nl', '_system', 'location=yes');


Can you try?
Photo of Giuseppe

Giuseppe

  • 2 Posts
  • 0 Reply Likes
But as Yeradis sais, this is not a solution for our needs.

When my app retrieve data from the REST API, and show the HTML content, I don't have control about links of this HTML, in form of
<a href="....."></a>

My app have some buttons using window.open and working like a charm, but the solution we need, is a way to specify all links should be opened outside the app, because we havn't control about links of HTML content retrieved.
Photo of Amir

Amir

  • 8261 Posts
  • 263 Reply Likes
Hey guys

Topic likely related to PhoneGap Framework or programming, rather then Build service. Kindly please post and discussion at our PhoneGap Community Forum or at Stackoverflow.

*To get the most out of framework support, consider our PhoneGap Paid Support option: http://phonegap.com/support/

Thanks

This conversation is no longer open for comments or replies.