-
-
Notifications
You must be signed in to change notification settings - Fork 149
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
Detect more ZIMs for active content warning #889
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good
I'm wondering if we need to check some of the other ZIM types: we were to some extent relying on the fact that some of these ZIMs had inline script to detect active content, and now some of those have been addressed (not all yet). I should perhaps check the ZIM types that have been fixed, in case we need to add to this PR. |
You're right. |
OK, here is a list of ZIMs that should be tested (mirroring the list in #865):
|
To support detecting Gutenberg in the future, once inline JS is removed, we could detect this script: |
There are just two left to test: OpenEdx and Kolibri. Unfortunately, I have no idea which ZIMs actually represent these ZIM types! Any ideas @mossroy, @kelson42? It's not crucial to test them, as these are scrapers that haven't been updated yet, so they will still show the active content warning. However, we could future proof them, if they are sitll active projects, by including them in this PR. |
OpenEdx generates some moocs, see #789 (comment) and openzim/openedx#168 |
It's true that we should not rely on inline javascript detection any more (as we're making scrapers get rid of it). |
OK thanks -- I should have followed up the PRs. Khan Academy (specifically the one you linked) contains The OpenEdx one is a curious case: it actually runs better in jQuery mode than in Service Worker mode. All assets are browsable in jQuery mode, but in SW mode, the assets "break out" of the iframe, and so destroy the Kiwix JS reader. As it looks like this scraper won't get fixed (developer(s) have abandoned it??), I'll exempt this ZIM (via a unique JS it contains) so that we don't put up a misleading message to jQuery users. We might want to investigate if we can prevent the breakout from happening in SW mode, but only if it can be done in a generic way, which I doubt. |
Both scrapers are not abandoned, but openedx is pretty recent an kolibri still a work in progress. |
Ah, sorry, it was rgaudin saying "chances of a fix are low" for one of them that made me think this! Very glad to hear they are in progress. |
OK, I've finished testing all ZIMs. There is a bit of new code you should look at, @mossroy , because in order to exempt ZIMs containing the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I did not test, but it looks good to me.
New nautilus-based ZIMs don't trigger the active content warning in jQuery mode. This adds detection. There is also an incorrect instruction in the warning to "type a space". This doesn't do anything in Kiwix JS (in Kiwix JS Windows, typing a space opens a special Archive Index UI, and I think this instruction is a left-over from that).
We could make it so that typing a space displays the title index starting from the first entry within the current UI, but that would be a different PR.