Lars
Lars

Reputation: 10092

InAppBrowser events not firing in Cordova 3.0.0 / Android

Any suggestions on why I'm not getting events?

I'm opening the browser after deviceready:

document.addEventListener('deviceready', app.login, false);

I register the event listener, the login function below is called as expected, the foobar page opens, but I never get the "loadstart" (or any other) callbacks that I register for:

login: function () {
  console.log("login");
  var authorize_url = "foobar";
  var appInBrowser = window.open(authorize_url, '_blank', 'location=yes');
  appInBrowser.addEventListener('loadstart', function(event) { console.log('loadstart'); });
}

As far as I can tell I'm following the Cordova docs example. Thanks.

Upvotes: 2

Views: 995

Answers (1)

Lars
Lars

Reputation: 10092

Solution: Don't forget to manually install the plugin. Without the plug-in the browser will still show up, but events won't fire:

Use the command line interface:

cordova plugin add https://git-wip-us.apache.org/repos/asf/cordova-plugin-inappbrowser.git

Upvotes: 4

Related Questions