joseph / Monocle

A silky, tactile browser-based ebook JavaScript library.
http://monocle.inventivelabs.com.au
MIT License
743 stars 200 forks source link

No onLoadCallback on Android 4.2.x #187

Open ReDrUm opened 11 years ago

ReDrUm commented 11 years ago

Hey,

I'm having issues with Monocle 3.x inside a WebView on Android 4.2.x.

The onLoadCallback when initiating Monocle is never triggered:

Monocle.Reader('divID', bookData, options, function(rdr) { alert("Success"); });

Visually the epub's first page is rendered, however no interactivity is initiated, I can't change pages.

Ironically it works fine inside a remote website when viewed inside Android's Chrome browser, however when the same code is used within a WebView the onload callback never triggers (presumably due to some error during init).

The same code works fine within any desktop browser, and Safari on iOS.

Any ideas?

Cheers,

Tim

joseph commented 11 years ago

I have not worked with iOS or Android WebViews, but in the past, people have reported that security policies (eg, preventing JS running in files loaded from file:///) can interfere with initialization. Do you have access to the JS console output from the WebView? That might give you a clue.