![]() |
#16 |
Sigil Developer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 8,019
Karma: 5449552
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 01:44 PM. |
![]() |
![]() |
![]() |
#17 |
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 1,582
Karma: 7043711
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. |
![]() |
![]() |
Advert | |
|
![]() |
#18 |
Sigil Developer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 8,019
Karma: 5449552
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. |
![]() |
![]() |
![]() |
#19 |
Sigil Developer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 8,019
Karma: 5449552
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 02:22 PM. |
![]() |
![]() |
![]() |
#20 |
Sigil Developer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 8,019
Karma: 5449552
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). |
![]() |
![]() |
Advert | |
|
![]() |
#21 | |||
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 1,582
Karma: 7043711
Join Date: Mar 2013
Location: Rosario - Santa Fe - Argentina
Device: Kindle 4 NT
|
Quote:
Quote:
![]() Quote:
|
|||
![]() |
![]() |
![]() |
#22 |
Sigil Developer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 8,019
Karma: 5449552
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? |
![]() |
![]() |
![]() |
#23 |
Sigil Developer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 8,019
Karma: 5449552
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 06:20 PM. |
![]() |
![]() |
![]() |
#24 |
Sigil Developer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 8,019
Karma: 5449552
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. |
![]() |
![]() |
![]() |
#25 | |
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 1,582
Karma: 7043711
Join Date: Mar 2013
Location: Rosario - Santa Fe - Argentina
Device: Kindle 4 NT
|
Quote:
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. |
|
![]() |
![]() |
![]() |
#26 | |
Sigil Developer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 8,019
Karma: 5449552
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:
Last edited by KevinH; 06-03-2021 at 09:10 AM. |
|
![]() |
![]() |
![]() |
#27 | |
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 1,582
Karma: 7043711
Join Date: Mar 2013
Location: Rosario - Santa Fe - Argentina
Device: Kindle 4 NT
|
Quote:
![]() |
|
![]() |
![]() |
![]() |
#28 |
Junior Member
![]() Posts: 4
Karma: 10
Join Date: Jun 2021
Device: Lithium (Android)
|
![]()
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?
|
![]() |
![]() |
![]() |
#29 |
Sigil Developer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 8,019
Karma: 5449552
Join Date: Nov 2009
Device: many
|
Does it work in BibiReader? Does it work in ReadiumReader?
And most importantly does your epub pass epubcheck? |
![]() |
![]() |
![]() |
#30 |
Junior Member
![]() Posts: 4
Karma: 10
Join Date: Jun 2021
Device: Lithium (Android)
|
|
![]() |
![]() |
![]() |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
[Plugin] ePub3-itizer - epub3 output plugin for Sigil | KevinH | Plugins | 435 | 01-19-2023 09:46 PM |
Errors Using plugins with Sigil | increase | Plugins | 3 | 03-06-2020 05:08 AM |
Sigil Plugins! | DiapDealer | Sigil | 33 | 03-19-2016 08:18 PM |
Sigil Plugins (for Sigil 0.7xx Alpha) | DiapDealer | Sigil | 15 | 09-27-2014 05:21 PM |
An epub3 version of Sigil ? | apulia03 | Sigil | 9 | 11-28-2012 01:07 AM |