mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Report document URL in domready event as well
This commit is contained in:
parent
a0c9005d69
commit
7a4a6d0d19
@ -21,7 +21,7 @@
|
||||
send_msg({type: 'print', text: text});
|
||||
}
|
||||
|
||||
if (!document.location.href.startsWith('chrome-error:') && !document.location.href.startsWith('about:')) {
|
||||
send_msg({type: 'domready', html: new XMLSerializer().serializeToString(document)});
|
||||
if (document.location && document.location.href && !document.location.href.startsWith('chrome-error:') && !document.location.href.startsWith('about:')) {
|
||||
send_msg({type: 'domready', url: document.location.href, html: new XMLSerializer().serializeToString(document)});
|
||||
}
|
||||
})();
|
||||
|
@ -16,7 +16,9 @@ from calibre.gui2.webengine import create_script, insert_scripts
|
||||
|
||||
|
||||
def canonicalize_qurl(qurl):
|
||||
qurl = qurl.adjusted(QUrl.UrlFormattingOption.StripTrailingSlash | QUrl.UrlFormattingOption.NormalizePathSegments)
|
||||
qurl = qurl.adjusted(
|
||||
QUrl.UrlFormattingOption.StripTrailingSlash | QUrl.UrlFormattingOption.NormalizePathSegments | QUrl.UrlFormattingOption.RemoveFragment
|
||||
)
|
||||
if qurl.path() == '/':
|
||||
qurl = qurl.adjusted(QUrl.UrlFormattingOption.RemovePath)
|
||||
return qurl
|
||||
|
Loading…
x
Reference in New Issue
Block a user