title: Consistent way to open links from Phonegap app in both Android and iOS?
body: <p>I have a mobile app made with Phonegap which displays news articles which may contain links. I want those links to open in a proper browser, seperate from the app. I cannot find a single way to do this which gives the <strong>same results in Android and iOS</strong> after I upgraded from Phonegap version to 2.0.0 to 2.1.0 (since you cannot rotate the screen in iOS prior to 2.1).</p>
  
  <hr>
  
  <p><code>&lt;a href="http://blah"&gt;</code><br>
  Always opens within the app, no browser toolbars, and no way to get back to the app without terminating it. iOS obeys <code>&lt;access origin="http://blah" /&gt;</code> in config.xml but Android doesn't. Neither seem to care about the <code>browserOnly="true"</code> attribute.</p>
  
  <p><code>&lt;a href="http://blah" target="_blank"&gt;</code><br>
  iPhone opens this within Safari browser if <code>&lt;access&gt;</code> allows it (or is omitted entirely), but Android opens it within the app .</p>
  
  <p><code>&lt;preference name="stay-in-webview" value="false" /&gt;</code><br>
  Adding this to config.xml makes no difference at all.</p>
  
  <p><code>&lt;a href="#" onClick="navigator.app.loadUrl('http://blah',{openExternal:true});return false;"&gt;</code><br>
  Only supported in Android, where it opens the link in Chrome browser. Errors in iOS.</p>
  
  <p><code>&lt;a href="#" onClick="window.open('http://blah','_blank','location=yes');return false;"&gt;</code><br>
  In Phonegap version 2.3.0 this will stay within the app but shows a cheap-looking browser toolbar at top/bottom with a button that allows you to return to the app. This is consistent...but not what I want. (In version 2.1.0 this causes Android to open within the app and iOS to open in proper browser.)</p>
  
  <hr>
  
  <p>I am using Phonegap <strong>Build</strong> so <a href="http://www.rigelgroupllc.com/blog/2012/05/22/opening-links-in-phonegap-apps-in-mobile-safari/" rel="noreferrer">this solution</a> will not work.<br>
  The official documentation refers to <a href="https://build.phonegap.com/blog/access-tags" rel="noreferrer">this blog post</a> which was written with reference to version 1.5.0 and my 2.1.0 to 2.3.0 findings do not match with their table.<br>
  I don't really want to add a plugin for something this simple.</p>
  
  <p><strong>Is there a single piece of code which will cause a link to open in the device's own browser, outside of the app's webview, regardless of OS?</strong></p>