6

I would like for my web browser to be able to open and browse e-books natively. E-Books are a great source of knowledge, and their markup is HTML. Over time, browsers have progressed into presenting images, styles, sound, and even PDF and video. To me it seems like a given that e-books should and could also be handled natively - especially since their markup is familiar and file size is low.

This is connected to my feature request for Kagi to index e-book content online:
https://kagifeedback.org/d/1627-have-kagi-index-the-content-of-all-the-books-on-the-internet/10

Imagine what a wealth of knowledge if the Internet contains books that you can search for, browse and search in!

I'm attaching a screenshot of what a normal e-book looks like under the hood, just to get an idea of the technical aspect.

  • Vlad replied to this.

    carl Can you share a link to an ebook? If it is HTML, why does it not render in Orion?

    • carl replied to this.

      If they are .epub, the default behaviour is to download the files and open them in a reader. In the case of Apple devices, that's Apple Books

      For example: https://filesamples.com/samples/ebook/epub/Alices%20Adventures%20in%20Wonderland.epub

      There are extensions which will open things like EPUBs in the browser, such as this:
      https://addons.mozilla.org/en-CA/firefox/addon/epubreader/

      Is this what you are looking for out of the box in Orion @carl?

      • carl replied to this.

        Vlad

        Sure! Here is one from the project Standard Ebooks, they have a lot of books to test on:
        https://standardebooks.org/ebooks/upton-sinclair/oil/downloads/upton-sinclair_oil.epub

        Epub is a wrapper of the HTML, css, images and other content of an e-book. What I mean is that it shouldn't be very hard for the browser to unwrap this file format. There are other popular e-book file formats that could be investigated as well, since I suspect they also are just wrappers.

          Dustin

          Yes, these plugins exist and work with Orion, but they need you to open an EPUB you have on your computer. My opinion is that the browser should display EPUBs out of the box, just as with PDF files and images. If the Kagi crawler can do this and start crawling EPUBS as well, there will be a vast treasure of high quality information added to users.

          I think it would be cool if Orion could be the first browser to natively handle EPUBS, just as Chrome (I think) changed things forever by natively handling PDFs.

          I think it's a great suggestion. Is this something that could be built into Reader Mode perhaps?

          If I remember right Orion uses a js solution to display PDFs in the browser. I found this js solution to E-Books, that seems to be well-made:

          https://github.com/futurepress/epub.js/

          Here is their example of Moby Dick:

          https://futurepress.github.io/epubjs-reader/#epubcfi(/6/14[xchapter_001]!/4/2/2/2/2[c001s0000]/1:0)

          Fun thing is, any page in this book works with Safari reader mode, but not with Orion reader mode. I also think that their implementation could serve as an inspiration for reader mode, since they dynamically format the books to columns, based on the browser window height.

            I apologize that I'm on a little bit of a spree. Here is another Github project to render EPUB in the browser, their example is also Moby Dick:

            https://github.com/daisy/accessible-books-in-browsers

            I think their implementation is also fine, but they've opted for page turning buttons instead of scrolling, which is a bit weird.

            Here is an article by W3C talking about the same issue with E-books:

            https://w3c.github.io/dpub-pwp/#whynow

            • Vlad replied to this.

              carl Thanks for clarification. Can you do further research and land on the best js implementation of an epub reader that we should consider to ship with Orion? We will not have resources to further modify it, so it will need to work well out of the box.

              From my research, Futurepress epub.js seems like the best and most mature solution, it's the first script i mentioned.

              One issue with epub.js is that it doesn't give the user any option to download the book. I think that unless or until search engines start indexing e-books, most people will want to download the files and not read them in the browser. Sure, you can always right-click to download the source file, but maybe a more apparent option could be added? Kind of like how Safari handles PDF files?

              • Vlad replied to this.

                carl We can't add changing/maintaining an external js library to our workload. We can implement a js library for .epub and the community should recommend which one. I recommend asking the author to add this feature.

                  I've browsed through the Github repository, documentation and a lot of other places without finding anything about downloading the open book. It seems to me that this must be such a basic feature, can anybody with better programming knowledge find out if this is a feature of epub.js?

                  When researching, I found this candidate for an E-PUB viewer, which is very basic, but very performant form the example:

                  https://github.com/HadrienGardeur/webpub-viewer

                  Example:

                  https://hadriengardeur.github.io/webpub-manifest/examples/viewer/?manifest=true&href=https://hadriengardeur.github.io/webpub-manifest/examples/MobyDick/manifest.json&document=https://hadriengardeur.github.io/webpub-manifest/examples/MobyDick/html/title.html

                  The people behind it seem to be connected to the open source Readium project, which seems ambitious, and have already made some software that seems to be working:
                  https://readium.org/about/project_goals.html/

                  Finally, there's the Bibi javascript E-Pub reader, which has more options and more polish:
                  https://github.com/satorumurmur/bibi

                  They have some demos on their website, which is in Japanese:
                  https://bibi.epub.link/#demo

                  One solution if it's too much to mess with the scripts would be to have "Open e-books in browser" as a preference in Orion, thereby letting the user select desired behaviour. If it's enabled that would mean a user would have to right-click and "Save source as..." if they don't want to view the book.

                    We will wait for the community to come to the concensus about this, same as when we included pdf.js reader from Mozilla to replace the pdf viewer.

                    • carl replied to this.

                      After a bunch of research it turns out that the Yandex Browser already has E-Pub reading integrated, and it works absolutely brilliantly, with a button in the URL bar (Save) to download the currently open E-Pub. So it can be done, that is evident. Their implementation seems almost ideal.,

                        24 days later

                        I've been thinking about this, and I think the "Save" (or better "Download") button in the URL field is a perfect solution. This would also be great for PDF files when they are open using pdf.js, as well as images when they are open in their own tab/window. If you think about it, having to right-click an image and select "Save as" is not a very Mac-like way of working. Yandex browser is good inspiration.

                        There could even be a caret on the Download button, so that the user could select "Always download EPUB files" or "Always download PDF files", if they are no fan pdf.js or epub.js

                        This way there is no "hacking" of epub.js necessary.