title: PhoneGap: Open external link in default browser (outside the app)
body: <p>I'm trying to open links in Safari (on an iPhone) from a PhoneGap application. I'm using PhoneGap version 3.1.0, and use <a href="http://build.phonegap.com/">PhoneGap Build</a>, to build the application.</p>
  
  <p>I have two links on the page (shown below in www/index.html). Both links open inside the PhoneGap application. I can see that PhoneGap is loaded correctly, because <strong>alert('device ready!');</strong> is triggered.</p>
  
  <p>What do I need to change, to open the links in the default browser (outside the app)?</p>
  
  <p>The <strong>www/config.xml</strong> file looks like this:</p>
  
  <pre class="lang-xml prettyprint-override"><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  
  &lt;widget xmlns="http://www.w3.org/ns/widgets" xmlns:gap="http://phonegap.com/ns/1.0" id="com.company.appname" version="0.0.3"&gt;
    &lt;name&gt;AppName&lt;/name&gt;
    &lt;description&gt;description&lt;/description&gt;
    &lt;author href="http://www.example.com/" email="hello@example.com"&gt;
      Company
    &lt;/author&gt;
    &lt;preference name="phonegap-version" value="3.1.0" /&gt;
    &lt;preference name="orientation" value="portrait" /&gt;
    &lt;preference name="stay-in-webview" value="false" /&gt;
  
    &lt;gap:plugin name="org.apache.cordova.inappbrowser" version="0.2.3" /&gt;
    &lt;gap:plugin name="org.apache.cordova.dialogs" version="0.2.2" /&gt;
    &lt;gap:plugin name="com.phonegap.plugins.pushplugin" version="2.0.5" /&gt;
  
    &lt;plugins&gt;
      &lt;plugin name="InAppBrowser" value="CDVInAppBrowser" /&gt;
    &lt;/plugins&gt;
  
    &lt;feature name="InAppBrowser"&gt;
      &lt;param name="ios-package" value="CDVInAppBrowser" /&gt;
    &lt;/feature&gt;
    &lt;access origin="*" /&gt;
  &lt;/widget&gt;
  </code></pre>
  
  <p>The <strong>www/index.html</strong> file looks like this:</p>
  
  <pre class="lang-html prettyprint-override"><code>&lt;!DOCTYPE html&gt;
  &lt;html&gt;
  &lt;head&gt;
    &lt;meta charset="utf-8"&gt;
    &lt;meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1.0, user-scalable=no"&gt;
    &lt;title&gt;Test application&lt;/title&gt;
  &lt;/head&gt;
  &lt;body&gt;
    &lt;a href="#" onclick="openUrl('http://www.google.com/'); return false;"&gt;Link test 1&lt;/a&gt;
    &lt;a href="#" onclick="window.open('http://www.google.com/', '_system', 'location=yes'); return false;"&gt;Test link 2&lt;/a&gt;
  
    &lt;script src="phonegap.js"&gt;&lt;/script&gt;
    &lt;script src="cordova.js"&gt;&lt;/script&gt;
    &lt;script src="js/jquery-1.9.1.js"&gt;&lt;/script&gt;
    &lt;script type="text/javascript"&gt;
      function openUrl(url) {
        alert("open url: " + url);
        window.open(url, '_blank', 'location=yes');
      }
  
      function onDeviceReady() {
        alert('device ready!');
      }
      $(function() {
          document.addEventListener("deviceready", onDeviceReady, true);
      });
    &lt;/script&gt;
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>Here's the project structure:</p>
  
  <pre><code>├── platforms
  ├── plugins
  │   └── org.apache.cordova.inappbrowser
  │       ├── LICENSE
  │       ├── package.json
  │       ├── plugin.xml
  │       ├── README.md
  │       ├── RELEASENOTES.md
  │       ├── src
  │       │   ├── android
  │       │   │   ├── InAppBrowser.java
  │       │   │   └── InAppChromeClient.java
  │       │   ├── blackberry10
  │       │   │   └── README.md
  │       │   ├── ios
  │       │   │   ├── CDVInAppBrowser.h
  │       │   │   └── CDVInAppBrowser.m
  │       │   └── wp
  │       │       └── InAppBrowser.cs
  │       └── www
  │           ├── InAppBrowser.js
  │           └── windows8
  │               └── InAppBrowserProxy.js
  ├── README.md
  └── www
      ├── config.xml
      ├── cordova.js
      ├── index.html
      ├── js
      │   └── jquery-1.9.1.js
      └── phonegap.js
  </code></pre>