Skip to content

Commit

Permalink
Clean up
Browse files Browse the repository at this point in the history
  • Loading branch information
alessandroboron committed Dec 10, 2024
1 parent 160bc30 commit 8f0b90f
Showing 1 changed file with 5 additions and 3 deletions.
Original file line number Diff line number Diff line change
@@ -75,6 +75,8 @@ extension SpecialErrorPageNavigationHandler: WebViewNavigationHandling {

switch result {
case let .navigationHandled(.mainFrame(response)):
// Re-use the same request to avoid that the new sideload request is intercepted and cancelled
// due to parameters added to the header.
var request = response.navigationAction.request
request.url = response.errorData.url
isSpecialErrorPageRequest = true
@@ -132,11 +134,11 @@ extension SpecialErrorPageNavigationHandler: SpecialErrorPageUserScriptDelegate
if webView?.canGoBack == true {
_ = webView?.goBack()
} else {
forceCloseTab()
closeTab()
}
}

func forceCloseTab() {
func closeTab() {
delegate?.closeSpecialErrorPageTab()
}

@@ -148,7 +150,7 @@ extension SpecialErrorPageNavigationHandler: SpecialErrorPageUserScriptDelegate
navigateBackIfPossible()
case .maliciousSite:
maliciousSiteProtectionNavigationHandler.leaveSite()
forceCloseTab()
closeTab()
}
}

0 comments on commit 8f0b90f

Please sign in to comment.