kotlin-toolkit
kotlin-toolkit copied to clipboard
JavaScript preventDefault
Hello,
I am working on an interactive book for visually impaired children. I'm looking for an epub reader on android that would allow me to interact without being disturbed by the default actions of the reader. iBooks does it very well (see below).

Would it be possible to integrate this possibility in your application when using preventDefault ?
Thank you very much for the work you do.
Absolutely, and this is supposed to work already.
But we don't have much test books for this, so if you are able to share a sample ebook to test it would be super helpful.
I am preparing one for you now. I'm working with SVGs, maybe that's why it doesn't work!?
I'm working with SVGs, maybe that's why it doesn't work!?
I'm not sure, but I can take a look tomorrow. Could you setup a test with an SVG and one without? Thanks!
Hello here is a sample epub.
I use the ibooks.js script.
It works in Thorium.
Sorry for my late reply (computer problem).
No problem, thanks I will take a look on Friday.
I investigated the issue, the good news is that it's actually working and an easy fix.
The ibooks.js script is using the following to determine if the device is touch based:
iBooks.SUPPORTS_TOUCHES =
navigator.epubReadingSystem &&
navigator.epubReadingSystem.hasFeature("touch-events") &&
iBooks.SYSTEM !== "Windows";
Readium mobile is not implementing the epubReadingSystem object, so it's not recognized as a touch device. I will need to bring this issue up to the dev group before making changes related to this.
It works in Thorium.
Did you test this particular test book? I tried with the latest Thorium version and it didn't work.
Thorium seems to support epubReadingSystem so the issue might be different. I'm using macOS with a touchpad.
Did you test this particular test book? I tried with the latest Thorium version and it didn't work.
Yes and I have version 1.8 on PC
I'm sorry. It's my script that's wrong. I have to write
iBooks.SUPPORTS_TOUCHES = navigator.epubReadingSystem && navigator.epubReadingSystem.hasFeature("touch-events") || iBooks.SYSTEM !== "Windows";
Thanks for opening my eyes. It works in your app
That's one way of handling it! But having an epubReadingSystem on mobile might still make sense. I'll keep this issue opened for now. Thanks for reporting.
I'm going to tweak my script to make it work while waiting for an update. Thanks again for the work you do.