From ca808718f7427484f9e769702c4b7d9762c43935 Mon Sep 17 00:00:00 2001 From: Veloman Yunkan Date: Fri, 28 Nov 2025 17:02:49 +0400 Subject: [PATCH] Fix for kiwix-serve --nosearchbar In kiwix-serve --nosearchbar mode the viewer is still engaged and its setup must completed appropriately, otherwise the content requested via the URL is not loaded. --- static/skin/viewer.js | 6 ++++++ test/server.cpp | 4 ++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/static/skin/viewer.js b/static/skin/viewer.js index 40c6e12e..d8c87686 100644 --- a/static/skin/viewer.js +++ b/static/skin/viewer.js @@ -588,6 +588,7 @@ function setupViewer() { const kiwixToolBarWrapper = document.getElementById('kiwixtoolbarwrapper'); if ( ! viewerSettings.toolbarEnabled ) { + finishViewerSetup(); return; } @@ -636,6 +637,11 @@ function updateUIText() { function finishViewerSetupOnceTranslationsAreLoaded() { updateUIText(); + finishViewerSetup(); +} + +function finishViewerSetup() +{ handle_location_hash_change(); window.onhashchange = handle_location_hash_change; diff --git a/test/server.cpp b/test/server.cpp index 61e90a98..8e77c102 100644 --- a/test/server.cpp +++ b/test/server.cpp @@ -77,7 +77,7 @@ const ResourceCollection resources200Compressible{ { DYNAMIC_CONTENT, "/ROOT%23%3F/skin/taskbar.css" }, { STATIC_CONTENT, "/ROOT%23%3F/skin/taskbar.css?cacheid=42e90cb9" }, { DYNAMIC_CONTENT, "/ROOT%23%3F/skin/viewer.js" }, - { STATIC_CONTENT, "/ROOT%23%3F/skin/viewer.js?cacheid=914d363c" }, + { STATIC_CONTENT, "/ROOT%23%3F/skin/viewer.js?cacheid=00e0fdf3" }, { DYNAMIC_CONTENT, "/ROOT%23%3F/skin/fonts/Poppins.ttf" }, { STATIC_CONTENT, "/ROOT%23%3F/skin/fonts/Poppins.ttf?cacheid=af705837" }, { DYNAMIC_CONTENT, "/ROOT%23%3F/skin/fonts/Roboto.ttf" }, @@ -338,7 +338,7 @@ R"EXPECTEDRESULT( - + const blankPageUrl = root + "/skin/blank.html?cacheid=6b1fa032";