Home > DeveloperSection > Forums > Android InAppBrowser events not firing in phonegap build
Pravesh Singh
Pravesh Singh

Total Post:101

Points:709
Posted on    June-03-2013 2:21 AM

 Sencha Touch Sencha Touch 
Ratings:


 1 Reply(s)
 3110  View(s)
Rate this:
Hi Guys

I'm loading an external page with InAppBrowser and it seems like neither loadstart nor loadstop are been fired on Android. 

My line of code as following

var ref = window.open(url, '_blank', 'location=yes;');
ref.addEventListener('loadstart', function() {
    console.log('loadstart!');
    console.log(event.url);
});

Thanks 


AVADHESH PATEL

Total Post:604

Points:4228
Posted on    June-03-2013 8:54 AM

Hi Pravesh!

Try as following...

Make sure you load the right cordova-2.x.x.js file

// Platform: android

Include the InAppBrowser plugin in res/xml/config.xml

<plugin name="InAppBrowser" value="org.apache.cordova.InAppBrowser" />

Write the correct white-list tag (differs from iOS)

<access origin="https://domain.com" subdomains="true" />

You really have to include onDeviceReady like in the example files, that did the trick for me.

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

I hope it helpful for you.

Don't want to miss updates? Please click the below button!

Follow MindStick