readium-sdk icon indicating copy to clipboard operation
readium-sdk copied to clipboard

Displaying iFrame content on Android

Open modecolems opened this issue 10 years ago • 15 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.

modecolems avatar Apr 27 '15 12:04 modecolems

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?

danielweck avatar Apr 27 '15 13:04 danielweck

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.

modecolems avatar Apr 27 '15 13:04 modecolems

This is the bugfix I was referring to https://github.com/readium/SDKLauncher-Android/commit/bf9d6c711c1a36ccb8d270fec97e075e5bc9206d , 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)

danielweck avatar Apr 27 '15 14:04 danielweck

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

modecolems avatar Apr 28 '15 08:04 modecolems

@modecolems my email address is [email protected]

danielweck avatar Apr 28 '15 08:04 danielweck

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).

rkwright avatar Apr 28 '15 15:04 rkwright

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

modecolems avatar Apr 28 '15 15:04 modecolems

@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!

danielweck avatar Apr 28 '15 15:04 danielweck

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

modecolems avatar Apr 28 '15 16:04 modecolems

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?

danielweck avatar Apr 28 '15 16:04 danielweck

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.

modecolems avatar Apr 28 '15 17:04 modecolems

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

danielweck avatar Apr 28 '15 17:04 danielweck

Hi,

Still not rendering with the .xhtml extension.

modecolems avatar Apr 29 '15 07:04 modecolems

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).

danielweck avatar Apr 29 '15 07:04 danielweck

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.

modecolems avatar Apr 29 '15 07:04 modecolems