mwoffliner icon indicating copy to clipboard operation
mwoffliner copied to clipboard

WikimediaMobile: Collapsible sections are hidden

Open benoit74 opened this issue 10 months ago • 4 comments

This is a blocker for release at large of mwoffliner 1.14

See e.g. https://dev.library.kiwix.org/viewer#wikipedia_en_basketball_maxi_2025-02/A/Slovenia_men's_national_under-20_basketball_team

Image

Vs mwoffliner 1.13: https://library.kiwix.org/viewer#wikipedia_en_basketball_maxi_2024-06/A/Slovenia_men's_national_under-20_basketball_team

Image

This seems to impact all ZIMs, we also have the issue on Wikivoyage, see e.g. Climate section of Anchorage:

https://dev.library.kiwix.org/viewer#wikivoyage_en_all_maxi_2025-02/A/Anchorage

vs

https://library.kiwix.org/viewer#wikivoyage_en_all_maxi_2024-10/A/Anchorage

benoit74 avatar Feb 11 '25 08:02 benoit74

So, these sections are actually in the HTML, but their display is set to none:

Image

If we forcibly unhide them, we get:

Image

Jaifroid avatar Feb 11 '25 09:02 Jaifroid

At scrape time, all elements with style.display = 'none'; could remove the none, which effectively opens them, and allows the browser to decide whether to display as inline or block. NB, this shouldn't be done by a script running client-side because some clients can't run JS from the ZIM.

Note we've already been round the houses on this, in particular in #2074, #2096 and #2097! I guess the issue here is that these are divs rather than sections, as was the case with those fixes. But same principle applies.

Jaifroid avatar Feb 11 '25 09:02 Jaifroid

Indeed, I just missed it, thank you!

benoit74 avatar Feb 11 '25 10:02 benoit74

Postponing to later, with 2.0.0 we will focus on ActionParse API which does not suffer from this problem

benoit74 avatar Apr 03 '25 14:04 benoit74

@benoit74 AFAIK the collapsable sections are a "signature" of mobile-section API end-point. Considering that we will never scrape again with this end-point, I propose to close this issue because outdated.

kelson42 avatar Jun 25 '25 06:06 kelson42