Reputation: 1
I've seen plenty of examples of how to do this from content in the main html/js code of the cordova app,
for example:
window.open(url, "_system");
but it doesn't seem to work when the link is in the content already in an in app browser.
Any ideas how I could achieve this?
Thanks
Upvotes: 0
Views: 604
Reputation: 7244
That is not quite enough, I think you are missing step 1 below. Here are the steps I am using to get this to work well:
Make sure you have an access tag for the external site in your config.xml
as follows (obviously replacing *google*
with whatever matched your site).
<access origin="*google.*" launch-external="yes" />
Add a class to all the links you want to work this way. I use the external
class name
Add the following delegated event handler to your document (this example uses jQuery)
jQuery(document).delegate('.external', 'click', function (e) {
window.open(e.target.href, '_system');
e.preventDefault();
});
The e.preventDefault()
is important to ensure the browser does not try to handle the click itself
Now it should work
Upvotes: 2