readium / readium-sdk

A C++ ePub renderer SDK

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Displaying iFrame content on Android

modecolems opened this issue · comments

Hi guys,

I'm testing Readium SDK on Web, iOS and Android and I'm facing a problem on the Android platform. The reader cannot display iFrame content on Android while it works on the Web and on iOS.

capture d ecran 2015-04-27 a 14 01 33

Thx for your help,

Regards.

Mory.

This looks like a bug fixed a few days ago that affected pre-KitKat Android devices only (i.e. non-Chromium)
Are you using the latest code from the develop branch?

Hi, I'm using the master branch, but I got the bug on Lollipop too. I'll try the last develop branch.

Thx for the fast answer.

This is the bugfix I was referring to readium/SDKLauncher-Android@bf9d6c7 , as you can see it only affected the loadUrl() WebView API used by Android < KitKat.

If loading/rendering the HTML spine item still fails, could you please privately share the EPUB so I can investigate further? (this could be a bug related to regular expression matching of the head element)

Hi Daniel

Still fails on Android while this can be rendered on iOS and Web version. How can I share the EPUB to you ?

Regards

Dropbox.com is also good when the EPUB is too large for email (or blocked by a spam gateway since it is a zipfile under the covers).

It was pretty small, so I sent it by email. Did you receive it ?

@modecolems thank you for sharing the EPUB. There is an XHTML error in ext/quiz/index.html, I believe. Please add a CDATA section to your script tags, e.g.:

<script>
//<![CDATA[
...
...
//]]>
</script>

...or escape the ampersand & characters :)

Let us know if this solves your problem, thanks!

Even if I delete all script sections and only keep HTML content, it can not be displayed on Android :

capture d ecran 2015-04-28 a 18 01 01

capture d ecran 2015-04-28 a 18 01 48

Interesting. By the way, I removed the code that injects the navigator.epubReadingSystem Javascript into loading iframes, but the error persists. I wonder if it has anything to do with the fact that iframe elements have an object parent element?

I don't think so cause as I said, it works on the readium reader version for iOS and Web (and on others epub reader). It only fail to render on the Android version.

Can you please try with the .xhtml extension instead of .html? Many thanks!

Hi,

Still not rendering with the .xhtml extension.

Okay, good to know. I have just finished updating the ROM on my Android device, I am still on KitKat 4.4.4 / CyanogenMod 11 (Chromium-based web browser / WebView). I will run some tests again, using Chrome device inspector to show the HTTP content-type received by the WebView (should be XHTML, but will try with HTML to see if it helps).

Ok thx for testing. By the way, I tried on several devices running Android OS from 4.4 to 5.1. Same issue for all.

Regards.