0

Here we go again... I've been pulling my hair out trying to solve this one... again.

I cannot get my app to open external web links in the system browser. It was working in a previous version of Phonegap from Oct 2013. Now I am making some small changes to update the text and images in the apps, but now the links won't open in the system browser.

I have been following many threads around SO trying to solve the problem with no success. Here is the best one that I could find on the subject:

Links don't open in external browser in JQuery Mobile with PhoneGap

Here is the skinny:

Phonegap Build with Phonegap latest (The Phonegap website doesn't seem say what the latest version is, but is the one after archive 2.9.1)

JQuery Mobile 1.4.4

JQuery 1.11.1

Here are the excerpts from Config.xml:

    <preference name="stay-in-webview" value="false" />
    <access origin="*" subdomains="true"/>

Here is my code:

    <a data-role="button" data-icon="pencil" href="http://www.google.com" onclick="window.open(this.href,'_system'); return false;">Google</a>

It opens, in the inappbrowser, but I cannot get it to open in the system browser.

Thanks for your insight...

Community
  • 1
  • 1
  • check this http://stackoverflow.com/questions/15534630/phonegap-build-how-to-open-external-url-in-device-browser-on-android – Aravin Sep 19 '14 at 07:47

1 Answers1

0

Here is how I fixed my own problem.

In the config.xml:

<preference name="stay-in-webview" value="false" />
<gap:plugin name="org.apache.cordova.inappbrowser" />
<gap:plugin name="org.apache.cordova.geolocation" />

In my JQueryMobile Code added:

<script src="cordova.js"></script>

Replaced this call:

<a data-role="button" data-icon="pencil" href="http://goo.gl/maps/tFvMA" target=_blank>Get Directions</a>

With this call:

<a data-role="button" data-icon="fa-search" href="http://goo.gl/maps/tFvMA" onclick="window.open(this.href,'_system'); return false;">Get Directions</a>

Hope this helps someone...