kiwix-js-pwa icon indicating copy to clipboard operation
kiwix-js-pwa copied to clipboard

Support "page preview" feature of Wikipedia and Wikivoyage

Open Jaifroid opened this issue 2 years ago • 1 comments

This is the same as upstream https://github.com/kiwix/kiwix-js/issues/719. I would be happy to work on this upstream, but it might be better to experiment with the feasibility of this feature here, only because I already have the click infrastructure set up, whereas https://github.com/kiwix/kiwix-js/pull/680 failed. Happy to be corrected if this supposition is wrong.

Having said this, the modern way to do this would be to attach the required DOM nodes programmatically only when the user hovers over (or long-presses) a hyperlink. Detection would be done at iframe (or tab/window) level, making this compatible with SW mode -- this is similar to the mechanism used in https://github.com/kiwix/kiwix-js/pull/862.

This ticket is medium-to-long term. I don't have time to work on it right now, but it would be cool. Expected end result is as below. Our simple page extraction is very fast (a few tenths of a second on a good machine and modern browser), and we wouldn't be extracting assets other than one image (also very fast to extract).

image

Jaifroid avatar Jun 16 '22 17:06 Jaifroid

And here is a simple, short CSS file that sets up the balloon. It's pure CSS, which is cool (no JS!):

https://github.com/kazzkiq/balloon.css

Jaifroid avatar Jun 16 '22 17:06 Jaifroid