Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Software > Calibre > Viewer

Notices

Reply
 
Thread Tools Search this Thread
Old 06-27-2021, 08:41 PM   #1
avnermoshkovitz
Member
avnermoshkovitz began at the beginning.
 
Posts: 22
Karma: 10
Join Date: Jun 2021
Device: Any ereader for Android or iOS
Is there a Calibre equivalent ebook reader app in Android and iOS, that can read

I prepared an ebook that loads a javascript module file and it works ok with Calibre.
As I understand Calibre reader is not available on Android, and iOS.
(I'm aware of the Calibre Companion tool to connect to Android, and iOS devices)

I'm looking for an equivalent ebook reader on Android and iOS, that can read an ebook with javascript modules.
I installed a long list of Apps for Android, but most of them do not work ok.

The following ebook readers do not view the ebook file properly:
- FBReader
- Lithium
- eReader
- Rakuten Kobo
- Reading Now
- Libera Reader


The ebook reader KotobeeReader, can load a javascript module file, but it has some other problems.

I installed the CalibreBox app but I could not operate it, and I'm not sure if it is an ebook reader or a complementary tool like Calibre Companion.


Is there an Calibre equivalent ebook reader app in Android and iOS, that can read ebook with javascript module (ES6)?

Thanks,
Avner
avnermoshkovitz is offline   Reply With Quote
Old 06-27-2021, 08:45 PM   #2
kovidgoyal
creator of calibre
kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.
 
kovidgoyal's Avatar
 
Posts: 43,964
Karma: 22669822
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
Use the calibre content server, it has a builtin reader that is based on the same codebase as the calibre viewer.
kovidgoyal is online now   Reply With Quote
Advert
Old 06-28-2021, 07:39 PM   #3
avnermoshkovitz
Member
avnermoshkovitz began at the beginning.
 
Posts: 22
Karma: 10
Join Date: Jun 2021
Device: Any ereader for Android or iOS
Thanks kovidgoyal,

I tried running Calibre Content Server on Android and it does not view the ebook properly, compared to Calibre on Linux (which does view the ebook properly).
So I ran Calibre Content Server on the Linux machine itself, to verify that it runs properly, and it also does not view the ebook properly, compared to Calibre on Linux.

I run the Calibre, and enable Calibre Content Server like so:
Code:
calibre
button "Connect/share"
Select "Start Content server"
  [192.168.1.75 port 8080 HTTP]
I then open in the browser using http://192.168.1.75:8080
I do see a list of books, so that part is ok.

I then open a specific ebook that opens well with Calibre, but I see errors in the browser:
Code:
There was an error in the JavaScript from within the book 3 srcdoc:27048:47
WARNING: column layout broken, probably because there is some non-reflowable content in the book whose inline size is greater than the column size {"col_size":550, "gap":41, "scrollWidth":1734, "ncols":3.003384094754653, "desired_inline_size":undefined} 192.168.1.75:8080:481:17
Quote:
Use the calibre content server, it has a builtin reader that is based on the same codebase as the calibre viewer.
I can dig into the problem, but as I understand, calibre content server, should give the same results.

Is there manual on how to run and debug the Calibre Content Server?
Thanks

Last edited by avnermoshkovitz; 06-28-2021 at 07:41 PM.
avnermoshkovitz is offline   Reply With Quote
Old 06-28-2021, 10:25 PM   #4
kovidgoyal
creator of calibre
kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.
 
kovidgoyal's Avatar
 
Posts: 43,964
Karma: 22669822
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
That's a warning, not an error, and has to do with screen sizes. What actual error did you find?
kovidgoyal is online now   Reply With Quote
Old 06-29-2021, 06:08 PM   #5
avnermoshkovitz
Member
avnermoshkovitz began at the beginning.
 
Posts: 22
Karma: 10
Join Date: Jun 2021
Device: Any ereader for Android or iOS
Ok, to be exact, the error is:
Code:
Failed to resolve module specifier "./mydir/myscript.js". Invalid relative url or base scheme isn't hierarchical
I googled this error message and found this link that seems to be related to my problem.
I think that the problem is more general (and the root cause is not Calibre Content Server)
I think that the Calibre Reader and Calibre Content Server are using different technology stacks.

I'm not familiar with both tools, but it looks like:
  • Calibre Reader - uses I'm not sure what (I would love to know how ebook reader operates on html5, CSS and Javascript, without having to have a running web server)
  • Calibre Content Server - uses a web server context.
    and with the web server context, the imported javascript module "./mydir/myscript.js" has wrong relative path.

Quote:
Use the calibre content server, it has a builtin reader that is based on the same codebase as the calibre viewer.
Given your comment, I expected that Calibre Content Server, would just work viewing the ebook similar to how Calibre Reader views it.
Do I need to do something extra for Calibre Content Server to work the same as Calibre Reader?

Thanks,
Avner
avnermoshkovitz is offline   Reply With Quote
Advert
Old 06-29-2021, 10:07 PM   #6
kovidgoyal
creator of calibre
kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.
 
kovidgoyal's Avatar
 
Posts: 43,964
Karma: 22669822
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
It does work the same, you insist on using javascript modules, that's your problem. I suggest you not do that, and you will be fine.
kovidgoyal is online now   Reply With Quote
Old 06-30-2021, 04:02 AM   #7
avnermoshkovitz
Member
avnermoshkovitz began at the beginning.
 
Posts: 22
Karma: 10
Join Date: Jun 2021
Device: Any ereader for Android or iOS
Oh, is this a limitation?
I do use modules.
I use this code, with the modules, because I re-used code that works with a webserver.
If I need to adjust the existing code to not use modules (but if this is the only way, I will do it).
I did not know that this is a limitation.

I use Calibre Reader, with the modules, and it works ok. So I expected CalibreContentServer to work the same (because you said that it uses the same code).
Is there:
  • a restriction to not use modules when using the CalibreContentServer?
  • a manual that defines how to work with the CalibreContentServer?


Thanks,
Avner
avnermoshkovitz is offline   Reply With Quote
Old 07-11-2021, 11:03 PM   #8
avnermoshkovitz
Member
avnermoshkovitz began at the beginning.
 
Posts: 22
Karma: 10
Join Date: Jun 2021
Device: Any ereader for Android or iOS
Hi,

I transpiled m the ES6 modules using Webpack and Babel into a bundle.js file.
So there is no more use of ES6 modules.
I recreated the ebook and I can view it properly on the desktop.
A video recording of the ebook working ok can be seen in: https://drive.google.com/file/d/1nWv...ew?usp=sharing

But I can still not view it in mobile.

I run the Calibre, and enable Calibre Content Server like so:
Code:
calibre
button "Connect/share"
Select "Start Content server"
  [192.168.1.75 port 8080 HTTP]
I then open in the browser using http://192.168.1.75:8080
I select the ebook that opens well with Calibre on desktop, but I see errors in the browser:
Code:
overrideEventListenerPrototypes/EventTarget.prototype.addEventListener@webpack://lib1/./main.js?49:10
Snapshot of the error can be seen in:
https://drive.google.com/file/d/1urn...ew?usp=sharing

Thanks
avnermoshkovitz is offline   Reply With Quote
Old 07-11-2021, 11:06 PM   #9
kovidgoyal
creator of calibre
kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.
 
kovidgoyal's Avatar
 
Posts: 43,964
Karma: 22669822
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
Figure out what it is in your javascript the browser doesnt like and fix it.
kovidgoyal is online now   Reply With Quote
Old 07-12-2021, 03:17 AM   #10
avnermoshkovitz
Member
avnermoshkovitz began at the beginning.
 
Posts: 22
Karma: 10
Join Date: Jun 2021
Device: Any ereader for Android or iOS
I started calibre in debug mode, and in the log file I see the following error:

Code:
...
ERROR: webpack://lib1/./gui/SceneBar.js?:199: Fetch API cannot load clbr://internal.sandbox/view_sites. URL scheme "clbr" is not supported.
ERROR: webpack://lib1/./gui/SceneBar.js?:199: Uncaught (in promise) TypeError: Failed to fetch
INFO: webpack://lib1/./loaders/FileZip_withJson.js?:56: BEG setZipLoaderInstance
SceneBar.js is one of my files, and it calls
Code:
window.location.origin + '/view_sites';
which probably translates to
Code:
clbr://internal.sandbox/view_sites
on mobile I open 192.168.1.75:8080 via Firefox

From your experience, do you know if there is anything that can be done on the browser side in mobile to
- allow using window.location.origin?, or
- workaround window.location.origin to load another page, by other means?

Thanks
avnermoshkovitz is offline   Reply With Quote
Old 07-12-2021, 03:33 AM   #11
kovidgoyal
creator of calibre
kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.
 
kovidgoyal's Avatar
 
Posts: 43,964
Karma: 22669822
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
No you're really not going to be able to implement navigation via javascript. What is it you are actually trying to do?
kovidgoyal is online now   Reply With Quote
Old 07-13-2021, 10:19 PM   #12
avnermoshkovitz
Member
avnermoshkovitz began at the beginning.
 
Posts: 22
Karma: 10
Join Date: Jun 2021
Device: Any ereader for Android or iOS
Ok, I was able to get by without navigation in javascript.

I'm trying to run some html5+javascript+css code in mobile in stand-alone.
The user:
  • opens a lean ebook (in epub format)
  • clicks on a button that opens a file input dialog
  • selects a .zip file with images
  • the images are then displayed in the ebook

the ebook can viewer successfully via:
  • Calibre on the desktop
  • Calibre Content Server on the desktop

A short clip that shows how the button responds to Calibre Content Server in the desktop, can be see in here: https://drive.google.com/file/d/1hff...ew?usp=sharing

I want to make it work similarly, on mobile.

I don't know if this is typical operation of an ebook.
But, if it will work on mobile it will be very nice, and I will be very happy

Thank you!
avnermoshkovitz is offline   Reply With Quote
Old 07-13-2021, 10:25 PM   #13
kovidgoyal
creator of calibre
kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.
 
kovidgoyal's Avatar
 
Posts: 43,964
Karma: 22669822
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
What error do you get when you try to do it? Most likely you are running into cross site restrictions since ebook content is displayed in a sandboxed iframe
kovidgoyal is online now   Reply With Quote
Old 07-14-2021, 06:56 AM   #14
MicroDrie
Connoisseur
MicroDrie ought to be getting tired of karma fortunes by now.MicroDrie ought to be getting tired of karma fortunes by now.MicroDrie ought to be getting tired of karma fortunes by now.MicroDrie ought to be getting tired of karma fortunes by now.MicroDrie ought to be getting tired of karma fortunes by now.MicroDrie ought to be getting tired of karma fortunes by now.MicroDrie ought to be getting tired of karma fortunes by now.MicroDrie ought to be getting tired of karma fortunes by now.MicroDrie ought to be getting tired of karma fortunes by now.MicroDrie ought to be getting tired of karma fortunes by now.MicroDrie ought to be getting tired of karma fortunes by now.
 
Posts: 58
Karma: 438844
Join Date: Aug 2019
Device: PC, Linux Mint, Tablet, and Telephone
Have you tried the free Gitden reader for android and IOS? A PDF reader add-in is also available. You can find a description here: https://www.print2eforms.com/gitden-reader/
MicroDrie is offline   Reply With Quote
Old 07-15-2021, 12:38 AM   #15
avnermoshkovitz
Member
avnermoshkovitz began at the beginning.
 
Posts: 22
Karma: 10
Join Date: Jun 2021
Device: Any ereader for Android or iOS
Quote:
Originally Posted by kovidgoyal View Post
What error do you get when you try to do it?
I start calibre in debug mode, connect the phone via usb, and debug with chrome devtools.

I don't see any errors:
  • in calibre log file e.g.
    tail -f /tmp/tmp1xn6mnyy.txt
  • in chrome devtools,
    the console pane shows only valid log messages
    the network pane does not show any failed requests

In EPUB/package.opf, I see an option for another book reader:
Code:
<meta property="ibooks:interactive">true</meta>
Could it be that some setting for calibre, similar to this is missing?

The problem can be seen in the following clip:
https://drive.google.com/file/d/1vuX...ew?usp=sharing
  • Calibre - ok - clicking on dot displays an image
  • Calibre Content Server on desktop - ok - clicking on dot displays an image
  • Calibre Content Server on mobile - NOT ok - clicking on dot DOES NOT display an image

I prepared a minimal example that shows the problem.
The epub can be downloaded from here:
https://drive.google.com/file/d/1UuB...ew?usp=sharing

kovidgoyal, can you please take a look at the attached ebook?
It is very small (~233 KB) but is enough to demonstrate the problem.

Thank you!
avnermoshkovitz is offline   Reply With Quote
Reply


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Are there any iOS reader app that understands Calibre bookmarks? georgehuang Calibre 5 11-05-2020 10:54 PM
Announcing Qurika - a Beautiful 3D eBook Reader for Android and iOS! jacob_qurika Self-Promotions by Authors and Publishers 43 05-19-2019 07:43 PM
Ebook reader for both iOS and Android? Lparsons21 Reading and Management 8 01-10-2019 09:50 PM
[Android] Can any app directly read the Calibre database? SoulkeepHL Devices 2 01-10-2013 08:21 PM
[Android App] Best Android reader software for use with Calibre / Calibre Companion ellett Devices 11 12-16-2012 04:27 PM


All times are GMT -4. The time now is 11:32 AM.


MobileRead.com is a privately owned, operated and funded community.