From d9ba81028c8e517416db97a42dd308e71b61685e Mon Sep 17 00:00:00 2001 From: Veloman Yunkan Date: Wed, 10 May 2023 15:54:15 +0400 Subject: [PATCH] Guaranteed activation of external link blocking This is a quickfix for the problem observed with external link blocking during certain history navigation actions (when the cached iframe content was loaded/restored before the viewer setup was completed). Since external link blocking doesn't depend on the translations (that are asynchronously loaded during the viewer setup) it can be performed unconditionally. However, the current dependence of `on_content_load()` on viewer setup has to be addressed too. --- 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 ca599a9c7..831d52bd4 100644 --- a/static/skin/viewer.js +++ b/static/skin/viewer.js @@ -336,8 +336,8 @@ let viewerSetupComplete = false; function on_content_load() { if ( viewerSetupComplete ) { handle_content_url_change(); - setup_external_link_blocker(); } + setup_external_link_blocker(); } function htmlDecode(input) { diff --git a/test/server.cpp b/test/server.cpp index 2b05864aa..2cec25e96 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=f872666c" }, + { STATIC_CONTENT, "/ROOT%23%3F/skin/viewer.js?cacheid=db02f59d" }, { 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";