Skip to content
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

Workaround for HTML URLs with percent-encoded querystring separators in zimit2 #577

Merged
merged 3 commits into from
Mar 25, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion www/js/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -5231,6 +5231,10 @@ function handleClickOnReplayLink (ev, anchor) {
} else {
zimUrl = pseudoNamespace + pseudoDomainPath + anchor.search;
}
// It is necessary to fully decode zimit2, as these archives follow OpenZIM spec
if (params.zimType === 'zimit2') {
zimUrl = decodeURIComponent(zimUrl);
}
// We need to test the ZIM link
if (zimUrl) {
ev.preventDefault();
Expand Down Expand Up @@ -5435,7 +5439,7 @@ function handleMessageChannelMessage (event) {
// Zimit ZIMs store assets with the querystring, so we need to add it!
title = title + event.data.search;
} else {
// Zimit archives store URLs encoded, and also need the URI component (search parameter) if any
// Zimit1 (classic) archives store URLs encoded, and also need the URI component (search parameter) if any
if (params.zimType === 'zimit') {
title = encodeURI(event.data.title) + event.data.search;
}
Expand Down