Hacker News new | ask | show | jobs
by blueflow 1241 days ago
A javascript codebase bundled with a webkit browser - is this like Electron, but lite?
3 comments

Ebooks are basically HTML, so this is one case where bundling a browser engine is going to be necessary in any case.
does it need a js engine though?
I took a quick look at the github repository (because I'm on macos), and it looks like it is written in javascript (and xml) using "gjs", which exposes the gnome libraries to javascript. So I think it's a gtk/gnome program, but written in javascript instead of C and using a webkit widget for the book itself.
App is written in JS and uses a JS library to render epub in the browser, how else could it work?
NOT "written in JS and use a JS lib"?
So you've some kind of problem with the implementation language? Because then you can say the same about any other. "Does it need to be written in Python?" "Does it need to be written in Rust?" What's even the point?
re-read what being discussed, someone said to display epub you need to able to render HTML, I said "but it does NOT need to RUN js". And then you were the person who brought up implementation language which happens to be js, which is irrelevant to the point everyone was making.
epub may contain JS
I do not think that is true. My incredibly quick skim of the epub format is not finding JavaScript.
GJS would be SpiderMonkey+GTK so no actual browser rendering is available until one pull in something like Webkit.
It's more like React Native, code in JavaScript but rendered with native components; webkit is for rendering epub view not the entire app.

Most ebook reader apps nowerdays use embed browser to render epub, with the notable exception of some apps on e-ink readers with their own parser and renderer, faster but at cost of maintenance effort and compatibilities.