From bea9f736dfd6ae950764aaf1235ed4cd6054fe34 Mon Sep 17 00:00:00 2001 From: Veloman Yunkan Date: Wed, 10 May 2023 14:54:48 +0400 Subject: [PATCH] fixup! Fixed external links in the viewer iframe --- static/skin/viewer.js | 2 +- test/server.cpp | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/static/skin/viewer.js b/static/skin/viewer.js index ee742d9bc..ca599a9c7 100644 --- a/static/skin/viewer.js +++ b/static/skin/viewer.js @@ -224,13 +224,13 @@ function handle_location_hash_change() { function handle_content_url_change() { const iframeLocation = contentIframe.contentWindow.location; console.log('handle_content_url_change: ' + iframeLocation.href); - document.title = contentIframe.contentDocument.title; const iframeContentUrl = iframeLocation.pathname; const iframeContentQuery = iframeLocation.search; const newHash = iframeUrl2UserUrl(iframeContentUrl, iframeContentQuery); if ( newHash.startsWith('catch/external?') ) { handleInterceptedExternalLink(newHash); } else { + document.title = contentIframe.contentDocument.title; history.replaceState(viewerState, null, makeURL(location.search, newHash)); updateCurrentBookIfNeeded(newHash); } diff --git a/test/server.cpp b/test/server.cpp index ba3c95b3a..2b05864aa 100644 --- a/test/server.cpp +++ b/test/server.cpp @@ -73,7 +73,7 @@ const ResourceCollection resources200Compressible{ { DYNAMIC_CONTENT, "/ROOT%23%3F/skin/taskbar.css" }, { STATIC_CONTENT, "/ROOT%23%3F/skin/taskbar.css?cacheid=bbdaf425" }, { DYNAMIC_CONTENT, "/ROOT%23%3F/skin/viewer.js" }, - { STATIC_CONTENT, "/ROOT%23%3F/skin/viewer.js?cacheid=aa7200e4" }, + { STATIC_CONTENT, "/ROOT%23%3F/skin/viewer.js?cacheid=f872666c" }, { 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" }, @@ -312,7 +312,7 @@ R"EXPECTEDRESULT( - + const blankPageUrl = root + "/skin/blank.html?cacheid=6b1fa032";