Skip to content

Commit

Permalink
sc - dont open cors in browser
Browse files Browse the repository at this point in the history
  • Loading branch information
scottpchow23 authored and whs committed Oct 10, 2021
1 parent c7de74d commit 754dec4
Showing 1 changed file with 11 additions and 10 deletions.
21 changes: 11 additions & 10 deletions runekit/app/view/browser_window.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,16 +43,17 @@ def acceptNavigationRequest(
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)

return False
# 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 super().acceptNavigationRequest(url, type_, is_main_frame)

Expand Down

0 comments on commit 754dec4

Please sign in to comment.