Footnotes in JavaScript

16 posts / 0 new
Last post

New version of Readium does not interprete my pop-up footnotes in JavaScript. The old version did it exellently.
I am adding here a short book where it possible to check footnotes: https://drive.google.com/open?id=0B35mGPyDpU99RGR0THdvWXMyNlk

Thanks for reporting this.  Can you give us a little more detail?  What exactly does "interpret" mean?   Do you mean previousl Readium displayed the footnotes but the latest version does not?

I will examine the book you posted for myself, but any additional details you could provide would be helpful.

I assume by "Readium" you mean the Chrome app downloaded from the Google Chrome store?

By "interpreting" I mean displaying of pop-ups. Previous versions of Readium (Chrome app from the Google Chrome store) always displayed my footnotes. I have created almost 300 epubs and until now there was no problem with pop-ups made in my way. Program Gitden for Android also displays the footnotes. So something has changed in new Readium.

I have verified that it indeed does not work.  I have logged an issue here and we'll at it shortly.

@SK:  I did look into this just now and found out the probable cause of the problem (security exception).  You'll find my comments in the link above.  There are some other errors in the file, but they are not fatal (though they would cause it to be rejected by most stores).  I noted these problems in the issue as well.

It means that all my epubs made for years are now no good for Readium?! What about backward conformability?

Now I sent you mew version of the same epub (no errors according to EPUB Validators) https://drive.google.com/open?id=0B35mGPyDpU99TC1JOTVLM2xCRnM
Footnotes are also not displayed. What can I do?

Chrome is throwing the same exceptions.  I hate to say it, but it looks like Chrome recently tightened their security. And that is why it is happening.  But let me consult with some engineers on the team and we'll get back to you.

If I open each file .htm, .html, .xhtml in unzipped .epub all footnotes are displayed properly. So it is not fault of Chrome, especially that Gotden using also chrome displays notes OK. In prevous version of Readium all worked independently of epub version (2 or 3). Unfortunately old version is unavailable.

@SK: I have now verified to my satisfaction that it is in fact the release of Chrome 57 late last week that broke JavaScript in the Readium Chrome app.  It affects ALL JavaScript, including that in the EPUB Test Suite (102).  I have bumped the issue priority to "Blocking" and we are working on it.

@SK: I have taken your second version of the EPUB and modified it to enable the tiptex footnotes so they work in the Readium Chrome app.  You can find the EPUB here.  It still throws one exception, complaining about security.  Something about JQuery (BTW, you JQuery is quite old).  I don't understand it yet as it appears OK to me.  Still looking.  Also, the tooltips don't seem to be formatted correctly.  But I had to do some cut and paste, so I may have inadvertently mangled something.  In any case, it shows roughly how to do it in a "legal" way.

You might also want to take a look at this EPUB.  And this article on the Content Security Policy.

 

 

#rkwright: My all epubs2 were correctly displayed in Readium and Gitden. I checked them by FlightCrew. The last version of Readium does not display not only pop-up notes but also does not display title of images, which were previously shown. Each browser display these titles (syntax: <img src="123.gif" alt-"" title="Abc etc..." />). Changes in new version of Readium spoiled that simple action. I'm afraid that I will find something else what has changed for worse.

@SK:  We apologize for the problem. Believe me, we are very unhappy, but this is beyond our control. We have consulted with Google directly and got no joy there.  This changes is part of their continuing campaign to make the browsers more secure against attacks and malware.  The Readium Chrome app is subject to these new rules because the app had special access to the browser (in order to store books, for example) whereas the browsers are not subject to these new rules.  That is why your content works in the browser and not Readium.

I don't know what your use-case is for your EPUBs, but you might want to investigate the Readium CloudReader, which is essentially the same code as the Chrome app, but is a pure browser-based version.  The primary difference is that in the app you can add books easily via UI, where as the CloudReader you have to edit the OPDS catalog to add books and you have to host the CloudReader yourself.  You can find more info here.

My epubs works ok in Gitden, if I introduce changes for Readium there will be necessity to make two versions of epub, one for Readium, one for Gitden. And what I have to do with 288 my epubs made for last 7 years (epubySK.pl)? I am really unhappy.

@SK:  We share your unhappiness.  We had no foreknowledge that Google would change these rules.

First, any changes you make to your EPUBs to make them work in the Readium Chrome app will also work in Gitden.  Those changes are, in fact, the correct way to implement the functionality.  Inline-scripts are a potential security hole and should be avoided.  Such scripts are OK in browsers because browsers have such strong sandboxing, but the Readium Chrome app is different because it has access to a private Chrome filesystem.  This is why Google instituted the new rules (and are, in fact, planning to do away with the apps entirely in 2018).  Gitden still works because they are not a hosted app but a standalone app.  That is what we are working on now, but it will take time to complete then we need to migrate all our (750k) users and their books - not a trivial task.

Second, I looked at your website and I think you should seriously look at the Readium CloudReader.  Take a look at this website and this one in particular.  Both of these sites use OPDS to manage the library, which is supported by the Readium CloudReader. In each case, there is an OPDS catalog that points to the EPUBs which are served from the site.  In some cases, the EPUBs are on another site entirely.

There are several advantages to this approach:

  • This approach is NOT subject to the new Content Security Protocol rules so no changes needed in your books
  • The books can be read in any browser, not just Chrome
  • You can have thumbnails of the books rather than just a text line

The disadvantage is that the user DOES need to be online to read the books - the CloudReader is not an "app" which supports offline reading.  We have begun work on a successor the Readium Chrome app which will support offline reading, etc. but it will not be rolled out anytime soon - late 2017/2018 is more likely.  In the meantime, you could use the CloudReader.

Please let us know how we can help and, again, our apologies for the unforeseen present from our friends at Google.

For long time I avoided epub3 because I had troubles similar to present ones. Now I "bully" about that smal epub I sent you (only 50 pages). It passed test without errors but Readium does not displayed pop-ups. Now, very often checking when adding files, I created similar epub which displays pop-ups but it does not pass Epubcheck (https://drive.google.com/open?id=0B35mGPyDpU99STRlcFhhc2U4N3c). I don't understand how it is possible. Something is really bad with new Readium.
I make epubs for peoples which want read them on tablets during travel to work so CloudReader is inconvenient for them. Previous Readium and Gitden was best solutions for such a task. I checked many epub readers and I found that these two were ideal. Now all my work needs changes. Terrible job!
Sorry that I am complaining but suddenly I lost all results of my work. How many complains will be sent to me from readers!
Thank you for your patient to me. I took tour long time. That is last my letter to you.

Secondary menu