All I need to do is to open a external webpage link into iPad's browser (Safari, Chrome, etc) from an App Link.
PhoneGap 3.1 says it could be done through a plugin called InAppBrowser. Fine, I installed it and added these following lines in the config.xml
<plugin name="InAppBrowser" value="CDVInAppBrowser" />
<feature name="InAppBrowser">
<param name="ios-package" value="CDVInAppBrowser" />
</feature>
<access origin="*"/>
I then added a link in my page, which needs to open the webpage:-
<a class="linkexternal" href="#">asdf</a>
with the following JS
<script type="text/javascript">
$(document).on('click', ".linkexternal", function (e) {
e.preventDefault();
//window.open('http://apache.org', '_blank', 'location=no');
window.open('http://apache.org', '_system', 'location=yes');
});
</script>
It does open the page, but just opens spanning all over the screen with no controls. In the older version of PhoneGap, it showed me "Done" at the end, so that when I pressed the Done button, it used to bring me back to the app. But here, it shows me the whole page as the full screen and the only way to go back to the app is closing the app.
I just need it to show me the Done button either or just open the link in an external browser.
Additional Information
I tried open these three different links as a test; with '_system', '_blank' and '_self'
<a href="#" onclick="var ref = window.open('http://google.com', '_system');">Google (System Browser)</a><br /><br />
<a href="#" onclick="var ref = window.open('http://google.com', '_blank');">Google (InAppBrowser)</a><br /><br />
<a href="#" onclick="var ref = window.open('http://google.com', '_self');">Google (Webview)</a>
When I test these three links with '_system', '_blank' and '_self', only '_self' one opens as a full screen for the app, the rest give me the following error:-
_system
link gives this error:-
2013-11-12 11:44:58.878 XYZ[2063:60b] Failed to load webpage with error: The operation couldn’t be completed. (NSURLErrorDomain error -999.)
_blank
link gives this error:-
2013-11-12 11:46:13.997 XYZ[2063:60b] CDVWebViewDelegate: Navigation started when state=1
2013-11-12 11:46:13.997 XYZ[2063:60b] Failed to load webpage with error: CDVWebViewDelegate: Navigation started when state=1
2013-11-12 11:46:13.999 XYZ[2063:60b] Resetting plugins due to page load.
2013-11-12 11:46:14.009 XYZ[2063:60b] Failed to load webpage with error: The operation couldn’t be completed. (NSURLErrorDomain error -999.)