Reputation: 50
This is my first time writing a mobile app using cordova. When the user navigates to my page, I want it to automatically display an external webpage. My first thought was to use an iframe, however I quickly realized that this is not a good way to do it, even if I whitelisted the site that I want. In searching I discovered the inappbrowser plugin.
The way it is typically used is as a link. For example:
<a href="{{url}}" onclick="window.open({{url}}, '_blank')">Link</a>
However I don't want the user to have to click anything for the inappbrowser to display the page. I simply want it to appear once the page has loaded. Could anyone suggest a way of doing this?
Upvotes: 0
Views: 1305
Reputation: 3101
var ref = cordova.InAppBrowser.open('http://apache.org', '_blank', 'location=yes');
window.open = cordova.InAppBrowser.open;
Documentation: http://cordova.apache.org/docs/en/latest/reference/cordova-plugin-inappbrowser/index.html
Upvotes: 0