-
-
Notifications
You must be signed in to change notification settings - Fork 37
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
Add Wikipedia preview function #595
Conversation
Some to-do items:
|
Feature is tested and working on Chromium and Firefox for desktop: mouseover is best method, but long-press also works for touchscreen users, and keyboard (tabbing into links) also evokes the popover. Also tested on UWP app, all working fine with mouseover and touch. On Android, an installed PWA can use the feature with long-press, and I've included different sizes for portrait and landscape orientation when there is a narrow screen. However, in Firefox for Android long-press seems to be hard-wired to the context menu and is not overridden. However, Firefox for Android cannot load large ZIM archives due to https://bugzilla.mozilla.org/show_bug.cgi?id=1807360, so I doubt anyone uses the PWA in that browser on Android. I have yet to test Safari / iOS in simulator. |
At least on Android, the icons top right are not consistently attached. |
Now working in Firefox for Android (with long-press), but close icons are not registering, despite some tweaks. Needs debugging. |
Finally icons are working on Firefox! |
All tested and working in Chrome (>=49), Firefox (>=68 - earlier versions work but don't support WebP), UWP (Edge Legacy), Safari on macOS. Ready to merge. |
Fixes #278.
This is currently specific to Wikimedia ZIMs (i.e. those scraped by mwOffliner) because the HTML has to be parsed based on certain tags provided by mwOffliner.
@kelson42 has suggested that a more generic way could be to snapshot a rendered (but hidden) view of the article and display a png. This would be more generic, although we need to think whether users would expect or even appreciate a generic preview. It's certainly the case that Wikipedia users expect such a feature (and this is the easiest case to cater for).
This feature should be ported upstream to Kiwix JS, but currently the click "infrastructure" is missing there in ServiceWorker mode (or rather, it is done differently), so the code would need to be adapted. See kiwix/kiwix-js#719.