mirror of
https://github.com/kiwix/libkiwix.git
synced 2025-06-27 21:39:37 +00:00
fixup! Fixed external links in the viewer iframe
This commit is contained in:
@ -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);
|
||||
}
|
||||
|
Reference in New Issue
Block a user