mirror of
https://github.com/bdnugget/runekit.git
synced 2026-11-07 09:07:30 +00:00
sc - dont open cors in browser
This commit is contained in:
1 parent
c7de74d4d9
commit
754dec4aba
1 file changed
+10
-9
@@ -43,16 +43,17 @@ class PageClass(QWebEnginePage):
|
||||
if not is_main_frame:
|
||||
return super().acceptNavigationRequest(url, type_, is_main_frame)
|
||||
|
||||
if (
|
||||
type_ != QWebEnginePage.NavigationTypeTyped
|
||||
and url.authority() != self.url().authority()
|
||||
):
|
||||
# The web is only allowed pages on the same origin
|
||||
# Cross origin pages would open in browser
|
||||
if url.scheme() in ("http", "https"):
|
||||
QDesktopServices.openUrl(url)
|
||||
# This breaks AFK Warden popups
|
||||
# if (
|
||||
# type_ != QWebEnginePage.NavigationTypeTyped
|
||||
# and url.authority() != self.url().authority()
|
||||
# ):
|
||||
# # The web is only allowed pages on the same origin
|
||||
# # Cross origin pages would open in browser
|
||||
# if url.scheme() in ("http", "https"):
|
||||
# QDesktopServices.openUrl(url)
|
||||
|
||||
return False
|
||||
# return False
|
||||
|
||||
return super().acceptNavigationRequest(url, type_, is_main_frame)
|
||||
|
||||
|
||||
Reference in new issue
Block a user