Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Kiwix-JS not reading Nautilus-based zim files #785

Closed
Popolechien opened this issue Dec 29, 2021 · 5 comments
Closed

Kiwix-JS not reading Nautilus-based zim files #785

Popolechien opened this issue Dec 29, 2021 · 5 comments
Labels

Comments

@Popolechien
Copy link
Member

Nautilus is a scraper that allows us to package a bunch of documents (PDF, Word, videos) together in a zim file.
I recently tried to open https://mirror.download.kiwix.org/zim/other/zimgit-post-disaster_en_2021-12.zim in my chrome browser (Kiwix-JS 3.2.0) and to my surprise (and dismay) the file could not be read.

This is a small but growing segment of content we have to offer, so I wanted to enquire if there was any chance that nautilus files could ever be read or if there is some major JS-related blocker that will always prevent it from happening.

@mossroy
Copy link
Contributor

mossroy commented Dec 29, 2021

Did you try with ServiceWorker mode instead of the jQuery mode?
You can switch to it in "Configuration" section, "Expert settings".

@mossroy
Copy link
Contributor

mossroy commented Dec 29, 2021

I could test your ZIM file, inside a Chromium extension.
The ZIM file uses javascript, so it can't work in jQuery mode.
But it also doesn't work in ServiceWorker mode because there is some inline javascript in home.html (line 82), which is rejected by the CSP of browser extensions :

Refused to execute inline script because it violates the following Content Security Policy directive: "script-src 'self' 'unsafe-eval'". Either the 'unsafe-inline' keyword, a hash ('sha256-PtO5L7mz44xgm8o7YDaYSxpBLHPVArwXn4bgl0rjzNw='), or a nonce ('nonce-...') is required to enable inline execution.

The solution is to update Nautilus to remove inline javascript, and move it in separate javascript files.
For this line 82, I suppose it should be easy to do, but It don't know if there are other inline javascripts generated by Nautilus.

I'll create a ticket on Nautilus

@Popolechien
Copy link
Member Author

@mossroy yes, to no avail

@mossroy
Copy link
Contributor

mossroy commented Dec 29, 2021

I just created openzim/nautilus#34 to consider fixing that in Nautilus

@Popolechien
Copy link
Member Author

Thanks a lot.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants