Reputation: 18610
I'm building a PhoneGap application with version 3.4.0 and testing on my iOS 7.1 iPad. I'm using the InAppBrowser object and hooking an event up to the loadstart
event. Every time the loadstart
event occurs and I try to access the url property on the even'ts object, it is undefined.
Here's my code:
var authInAppBrowser = window.open(myOAuthUrl, '_blank', 'location=yes');
$(authInAppBrowser).on('loadstart', function (e) {
// e.url is always undefined
window.alert(e.url);
});
There's a question posing a similiar problem, but the answer doesn't resolve my issue. According to the InAppBrowser documentation, the url property on the object is "the URL that was loaded. (String)".
How can I receive the URL that was loaded in the InAppBrowser plugin?
Upvotes: 1
Views: 975
Reputation: 18610
Using the native JavaScript way to add events made the URL appear:
var authInAppBrowser = window.open(authUrl, '_blank', 'location=yes');
authInAppBrowser.addEventListener('loadstart', function(e) {
window.alert(e.url);
});
Upvotes: 1