Open Jaifroid opened 3 months ago
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;
}
@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).
For upstream issue, see https://github.com/openzim/mwoffliner/issues/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'sstyle
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.