kiwix / kiwix-tools

Command line Kiwix tools: kiwix-serve, kiwix-manage, ...
https://download.kiwix.org/release/kiwix-tools/
GNU General Public License v3.0
407 stars 79 forks source link

Handling of `target="_blank"` links in kiwix-serve is not working properly inside the viewer #678

Open benoit74 opened 1 month ago

benoit74 commented 1 month ago

ZIM: mes-quartiers-chinois_fr_all_2024-05 on dev.library.kiwix.org Scraper: warc2zim 2.0.0-dev8 + zimit 2.0.0-dev5 + Browsertrix crawler 1.1.3 Browser: Firefox 126.0 on Mac OS Sonoma 14.5

When clicking on a link with target="_blank", this opens the href link both in a new browser tab and in current tab (replacing the whole tab content, not just the viewer iFrame).

Sample URL: https://dev.library.kiwix.org/viewer#mes-quartiers-chinois_fr_all_2024-05/mesquartierschinois.wordpress.com/2014/07/18/que-faire/

Search for "deux solitudes" link and click it.

image

image

When browsing without the iFrame (e.g. https://dev.library.kiwix.org/content/mes-quartiers-chinois_fr_all_2024-05/mesquartierschinois.wordpress.com/2014/07/18/que-faire/), behavior is normal / as expected.


Nota: with Chrome 125.0 on Mac OS Sonoma 14.5, it does not opens a new tab at all, it stays in same tab (probably still not correct).


This is similar to https://github.com/https://github.com/kiwix/kiwix-tools/issues/591 but still different.