E-book viewer: Allow clicking on calibre:// URLs. Fixes #2029014 [blocking navigation request to other books](https://bugs.launchpad.net/calibre/+bug/2029014)

This commit is contained in:
Kovid Goyal 2023-07-30 20:04:03 +05:30
parent 088954ae65
commit deec86c82b
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C
2 changed files with 2 additions and 2 deletions

View File

@ -348,7 +348,7 @@ class WebPage(QWebEnginePage):
return True
if url.scheme() in (FAKE_PROTOCOL, 'data'):
return True
if url.scheme() in ('http', 'https') and req_type == QWebEnginePage.NavigationType.NavigationTypeLinkClicked:
if url.scheme() in ('http', 'https', 'calibre') and req_type == QWebEnginePage.NavigationType.NavigationTypeLinkClicked:
safe_open_url(url)
prints('Blocking navigation request to:', url.toString())
return False

View File

@ -358,7 +358,7 @@ class WebPage(QWebEnginePage):
return True
if url.scheme() in (FAKE_PROTOCOL, 'data'):
return True
if url.scheme() in ('http', 'https') and req_type == QWebEnginePage.NavigationType.NavigationTypeLinkClicked:
if url.scheme() in ('http', 'https', 'calibre') and req_type == QWebEnginePage.NavigationType.NavigationTypeLinkClicked:
safe_open_url(url)
prints('Blocking navigation request to:', url.toString())
return False