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

Display of main article sections broken in Restricted mode for new mobile html endpoint Wikimedia ZIMs #1275

Open
Jaifroid opened this issue Aug 4, 2024 · 2 comments
Labels
bug-non-critical For bugs that it would be nice to fix rather than critical to fix upstream Issues that need to be dealt with at scraper level or some other repo
Milestone

Comments

@Jaifroid
Copy link
Member

Jaifroid commented Aug 4, 2024

For upstream issue, see openzim/mwoffliner#2074. The problem here is that in the source HTML the main article sections other than the first have the display: none; CSS style hard-coded into each <section> tag's style attribute. In ServiceWorker mode, some JS is run to remove that attribute after article load. However, in Restricted mode, no JS runs (it cannot), so the sections remain hidden and cannot be opened.

While this should be fixed upstream (in mwOffliner), we may be forced to deal with it ourselves before the next release if the issue isn't fixed in time.

@Jaifroid Jaifroid added upstream Issues that need to be dealt with at scraper level or some other repo bug-non-critical For bugs that it would be nice to fix rather than critical to fix labels Aug 4, 2024
@Jaifroid Jaifroid added this to the v4.2 milestone Aug 4, 2024
@Cibiyanna26
Copy link

Hello @Jaifroid,

I have doubts regarding this issue, rather than putting the inline CSS display:none;, will the issue gets resolved if we have a separate css file which targets the section and make it visible which don't rely on javascript.

section {
    display: block !important;
}

@Jaifroid
Copy link
Member Author

@Cibiyanna26 Yes, that could work, but the issue is that however we do it, we would need to inject it into the page somewhere. Note that Kiwix JS is a JavaScript reader, so the app simply won't work if users don't allow JS to run in their browsers. So unhiding the sections in the app by manipulating the DOM content once it is loaded into the iframe would also be viable. I rather think this should be fixed upstream (so that the sections are not unhidden using JS, but those styles are simply removed from the pages scraped in mwOffliner).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug-non-critical For bugs that it would be nice to fix rather than critical to fix upstream Issues that need to be dealt with at scraper level or some other repo
Projects
None yet
Development

No branches or pull requests

2 participants