fixup! Fixed external links in the viewer iframe

This commit is contained in:
Veloman Yunkan
2023-05-10 14:54:48 +04:00
parent a05d3fa65a
commit bea9f736df
2 changed files with 3 additions and 3 deletions

View File

@ -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);
}