Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Software > Sigil > Plugins

Notices

Reply
 
Thread Tools Search this Thread
Old 06-01-2021, 02:42 PM   #16
KevinH
Sigil Developer
KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.
 
Posts: 8,158
Karma: 5450818
Join Date: Nov 2009
Device: many
Okay, I added in BeckyEbook's new plugin icons for both BibiReader and EpubJSReader (thanks BeckyEbook!) and modified the BibiReader default.js to not disable or remove any local epub javascripts (per the epub3 standard).

See BibiReader_v0.2.0.zip and EpubJSReader_v0.2.0.zip from the links in the first post in this thread.

Please Note: Although currently rare - especially inside Sigil where you can see all of the source and given Sigil has a URLInterceptor to help deal with this issue - malicious epubs do exist that can exploit javascript to read in local files and pass them along. So please be careful showing any unknown epubs via these plugins before verifying its contents within Sigil first.

Last edited by KevinH; 06-01-2021 at 02:44 PM.
KevinH is offline   Reply With Quote
Old 06-02-2021, 02:53 PM   #17
RbnJrg
Wizard
RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.
 
Posts: 1,610
Karma: 8399999
Join Date: Mar 2013
Location: Rosario - Santa Fe - Argentina
Device: Kindle 4 NT
The epub I attach doesn't pass epubcheck if I don't include by hand:

"properties="scripted"

in the respective item of the .xhtml file in the .opf file. Why I include this comment in this thread? Because the epub can be read perfectly with the Readium and EreaderJS plugins but not with Bibi. But I think that the issue is not with Bibi but with its python wrapper. I say that because if I open with my browser the file "Index.html" present in the plugin's Bibi folder, and then I drop there the epub attached, Bibi can open it without problem. For some reason, when Bibi is launched with the plugin, it can't find the file "en-us.js" (maybe is not packeted in the .zip file generated by the plugin) and so can't display the epub.
Attached Files
File Type: epub Experiment I (epub3).epub (56.1 KB, 369 views)
RbnJrg is offline   Reply With Quote
Advert
Old 06-02-2021, 03:00 PM   #18
KevinH
Sigil Developer
KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.
 
Posts: 8,158
Karma: 5450818
Join Date: Nov 2009
Device: many
Yes use the epub3 tools to update the manifest properties. It should look for script tags and update the manifest properly.

I will play around with your test case.
KevinH is offline   Reply With Quote
Old 06-02-2021, 03:10 PM   #19
KevinH
Sigil Developer
KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.
 
Posts: 8,158
Karma: 5450818
Join Date: Nov 2009
Device: many
I ran Tools->Epub3 Tools->Update Manifest Properties and it nicely detected the need for scripted and added it. Sigil has always worked like that. So I am not sure what you are asking?

As for Bibi and this epub, I had no trouble with it opening at all.

There is no en-us.js file anyplace in Bibi. It is part of the hyphenator code.

It appear to work just fine on my machine with the Bibi plugin.

Perhaps you might want to try loading the en-js script as well in
your xhtml file:

<script src="../Misc/en-us.js" type="text/javascript"></script>

Last edited by KevinH; 06-02-2021 at 03:22 PM.
KevinH is offline   Reply With Quote
Old 06-02-2021, 03:32 PM   #20
KevinH
Sigil Developer
KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.
 
Posts: 8,158
Karma: 5450818
Join Date: Nov 2009
Device: many
You are running your tests as an output plugin via Sigil and not using the included demo python file right? That demo file is just there for proof of concept and has not been debugged or even tested much on Windows.

I just checked and the epub/zip handed to Bibi does have all of the js code in it. So if you are seeing a problem, that is not the cause.

But again, I can not see any issues at all on my machine with your epub testcase and Bibi (the latest v020).
KevinH is offline   Reply With Quote
Advert
Old 06-02-2021, 04:13 PM   #21
RbnJrg
Wizard
RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.
 
Posts: 1,610
Karma: 8399999
Join Date: Mar 2013
Location: Rosario - Santa Fe - Argentina
Device: Kindle 4 NT
Quote:
Originally Posted by KevinH View Post
You are running your tests as an output plugin via Sigil and not using the included demo python file right?
Yes, I'm not using "reader_demo_v3.py" file. After installing the plugin, I run it by clicking on its icon in the toolbar.

Quote:
There is no en-us.js file anyplace in Bibi. It is part of the hyphenator code.
Yes, of course, I know that And I had to change the Hyphenator.js code in order the script were able to localize that file. Originally, Hyphenator has a folder named "Patterns" where are stored the hyphen patterns (not only "en", but also "es", "fr", etc., etc.). But in an epub, it's not possible for Hyphenator to locate the proper language file (because the Patterns folder doesn't exist), so I must include it in the ebook and must tell the script where to find it.

Quote:
But again, I can not see any issues at all on my machine with your epub testcase and Bibi (the latest v020).
In my system I just can see a blank page after running Bibi v020 plugin with the epub I attached. As I said, with Readium and EpubJS all is ok, but not with Bibi. But I can see epubs not scripted with Bibi.
RbnJrg is offline   Reply With Quote
Old 06-02-2021, 06:44 PM   #22
KevinH
Sigil Developer
KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.
 
Posts: 8,158
Karma: 5450818
Join Date: Nov 2009
Device: many
Are you using BibiReader v020 as I enabled JavaScript in it. When I load your test epub in Sigil and launch it via its icon, I see about 6 pages of text but now that I look again no hyphenation is readily apparent. Perhaps it is not running at all on my machine? And that is why I get no error message.

I will play around with it some more and see if I can get it working.

Bibi May still strip js that is not directly loaded. Did you try adding the script tag for en-us.js as well?
KevinH is offline   Reply With Quote
Old 06-02-2021, 07:02 PM   #23
KevinH
Sigil Developer
KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.
 
Posts: 8,158
Karma: 5450818
Join Date: Nov 2009
Device: many
Okay, I got no error because it was not running at all due to a typo I had locally (I was working on a v030 version). Once I reverted to the posted v0.2.0 version I see 6 blank pages with your test case.

In Sigil, I edited Section0001.xhtml and added the following line:

<script src="../Misc/en-us.js" type="text/javascript"></script>

immediately after this line:

<script src="../Misc/Hyphenator.js" type="text/javascript"></script>

And relaunched BibiReader. It showed all 6 pages with hyphenation enabled.

My guess is Bibi will still strip out any unused js files even with that default.js change.

That said, most browsers require a script tag before it will load any js code into memory before it can be used. I see in the Hyphenator code the load patterns routine where you made the change. It literally builds a script tag if it can find the en-us.js file and adds it to the DOM.

Are you sure basePath ends with a "/"?

If it tries to use xhr to load it instead it may run into cross site scripting restrictions. Also I did not see Chrome listed as a supported Browser in any of the Hyphenator.js code I looked at but I only skimmed it.

Hope this helps,

KevinH

Last edited by KevinH; 06-02-2021 at 07:20 PM.
KevinH is offline   Reply With Quote
Old 06-02-2021, 07:25 PM   #24
KevinH
Sigil Developer
KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.
 
Posts: 8,158
Karma: 5450818
Join Date: Nov 2009
Device: many
I just tried again *without* adding the en-us.js via a direct script tag in the xhtml file and this time it worked perfectly.

So it appears to be something is a bit flakey timing-wize about finding and loading the en-us.js file in Bibi but it is not something easily seen.

Give it a few tries with and without the added script tag and let me know what you see.
KevinH is offline   Reply With Quote
Old 06-03-2021, 09:59 AM   #25
RbnJrg
Wizard
RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.
 
Posts: 1,610
Karma: 8399999
Join Date: Mar 2013
Location: Rosario - Santa Fe - Argentina
Device: Kindle 4 NT
Quote:
Originally Posted by KevinH View Post
I just tried again *without* adding the en-us.js via a direct script tag in the xhtml file and this time it worked perfectly.
In principle, to add the en-us.js file via direct script tag is not neccesary (in fact, the ebook passes epubcheck without it). But I did what you said, and I added the "en-us.js" script tag and, it WORKED!

But the curious thing is that, after removing that tag, it continued working! I can't explain why that behaviour.

By the way, the plugins for three different e-readers were very nice additions. Many thanks for that.
RbnJrg is offline   Reply With Quote
Old 06-03-2021, 10:08 AM   #26
KevinH
Sigil Developer
KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.
 
Posts: 8,158
Karma: 5450818
Join Date: Nov 2009
Device: many
That is exactly the same strange behaviour that I am seeing with Bibi and your test case.

I am scratching my head as to why it acts like that.

I took a look at the Bibi js code itself and all that 'allows-scripts-in-content' does is control whether Bibi's DOM strips out all script tags on load or not.

So something is a bit strange with Bibi but it is hard to track down given all of its code has been minimized, and all his code is done via Promises.

Them rewriting the DOM tree so much makes me worry about what else they are stripping out. There is a whole sanitizer.js extension for that.

Sorry I can not be more help here.


Quote:
Originally Posted by RbnJrg View Post
In principle, to add the en-us.js file via direct script tag is not neccesary (in fact, the ebook passes epubcheck without it). But I did what you said, and I added the "en-us.js" script tag and, it WORKED!

But the curious thing is that, after removing that tag, it continued working! I can't explain why that behaviour.

By the way, the plugins for three different e-readers were very nice additions. Many thanks for that.

Last edited by KevinH; 06-03-2021 at 10:10 AM.
KevinH is offline   Reply With Quote
Old 06-03-2021, 10:36 AM   #27
RbnJrg
Wizard
RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.
 
Posts: 1,610
Karma: 8399999
Join Date: Mar 2013
Location: Rosario - Santa Fe - Argentina
Device: Kindle 4 NT
Quote:
Originally Posted by KevinH View Post
That is exactly the same strange behaviour that I am seeing with Bibi and your test case.

I am scratching my head as to why it acts like that.

I took a look at the Bibi js code itself and all that 'allows-scripts-in-content' does is control whether Bibi's DOM strips out all script tags on load or not.

So something is a bit strange with Bibi but it is hard to track down given all of its code has been minimized, and all his code is done via Promises.

Them rewriting the DOM tree so much makes me worry about what else they are stripping out. There is a whole sanitizer.js extension for that.

Sorry I can not be more help here.
No problem Kevin, I appreciate your help. I realize that is not an issue related with your work; the issue is with Bibi. Let's hope no other problem appears
RbnJrg is offline   Reply With Quote
Old 06-07-2021, 10:35 AM   #28
AndrewRyzhkin
Junior Member
AndrewRyzhkin began at the beginning.
 
Posts: 4
Karma: 10
Join Date: Jun 2021
Device: Lithium (Android)
Question

Hello everyone! I'm creating a new Epub3 book, making a table of contents. But in EpubJSReader it doesn't work, nothing happens when you click on the links. In other books, everything works fine, including the Sigil help. What could be wrong?
AndrewRyzhkin is offline   Reply With Quote
Old 06-07-2021, 10:48 AM   #29
KevinH
Sigil Developer
KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.
 
Posts: 8,158
Karma: 5450818
Join Date: Nov 2009
Device: many
Does it work in BibiReader? Does it work in ReadiumReader?

And most importantly does your epub pass epubcheck?
KevinH is offline   Reply With Quote
Old 06-07-2021, 11:14 AM   #30
AndrewRyzhkin
Junior Member
AndrewRyzhkin began at the beginning.
 
Posts: 4
Karma: 10
Join Date: Jun 2021
Device: Lithium (Android)
Quote:
Originally Posted by KevinH View Post
Does it work in BibiReader? Does it work in ReadiumReader?
Yes, it works. It also works in all the android book readers that I tested (Lithium, Moon reader, and others). I checked on validator.idpf.org, no errors.
AndrewRyzhkin is offline   Reply With Quote
Reply


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
[Plugin] ePub3-itizer - epub3 output plugin for Sigil KevinH Plugins 456 10-27-2024 07:00 AM
Errors Using plugins with Sigil increase Plugins 3 03-06-2020 06:08 AM
Sigil Plugins! DiapDealer Sigil 33 03-19-2016 09:18 PM
Sigil Plugins (for Sigil 0.7xx Alpha) DiapDealer Sigil 15 09-27-2014 06:21 PM
An epub3 version of Sigil ? apulia03 Sigil 9 11-28-2012 02:07 AM


All times are GMT -4. The time now is 02:29 PM.


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