Reputation: 3700
I am using progressbar.js Progress Bar in a Cordova app.
My cordova app opens a remote html page (same network, but remote to the device) using the 'inAppBrowser' plugin.
All works as expected when I debug/test in Ripple, but when on the Android device, the progress bar just fails to initialise when this page is viewed in the 'inAppBrowser'.
I have tried two different Android devices with the same result.
When the same page with progress bar is viewed on Android in the normal Chrome browser, it works as expected. My app just navigates to this page using the 'inAppBrowser', and that is where it breaks.
All other JS works fine in pages viewed by the 'inAppBrowser', so it is something specific to progressbar.js .
I am not sure how to debug this one, as it's most certainly a javascript error being thrown somewhere, but I can't debug the 'inAppBrowser' page on the Android device at all. (Or better, I don't know how/if I can do it?)
Chrome remote debugging makes use of running your code in Chrome on the Android device, and that is where my page actually runs so I can't see how that will help me.
Any advice?
Thanks
Upvotes: 0
Views: 521
Reputation: 750
Having looked at the documentation
it looks like you can use:
inAppBrowserRef.addEventListener('loaderror', loadErrorCallBack);
function loadErrorCallBack(params) {
$('#status-message').text("");
var scriptErrorMesssage =
"alert('Sorry we cannot open that page. Message from the server is : "
+ params.message + "');"
inAppBrowserRef.executeScript({ code: scriptErrorMesssage }, executeScriptCallBack);
inAppBrowserRef.close();
inAppBrowserRef = undefined;
}
Upvotes: 0
Reputation: 750
Inpect with chrome developer tools chrome://inspect/#devices
will allow remote debugging of any page loaded in chrome on the android device, so assuming that you use inappbrowser to load the page into chrome this will allow you to see what is going on.
Upvotes: 1