Skip to content

Commit

Permalink
Fix brave/brave-ios#7796, Fix brave/brave-ios#6966: Use `webViewDidCl…
Browse files Browse the repository at this point in the history
…ose` to handle `window.close` (brave/brave-ios#7797)
  • Loading branch information
kylehickinson authored Jul 28, 2023
1 parent f746765 commit ddf81e8
Showing 1 changed file with 6 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -879,6 +879,12 @@ extension BrowserViewController: WKUIDelegate {

return newTab.webView
}

public func webViewDidClose(_ webView: WKWebView) {
guard let tab = tabManager[webView] else { return }
tabManager.addTabToRecentlyClosed(tab)
tabManager.removeTab(tab)
}

fileprivate func shouldDisplayJSAlertForWebView(_ webView: WKWebView) -> Bool {
// Only display a JS Alert if we are selected and there isn't anything being shown
Expand Down

0 comments on commit ddf81e8

Please sign in to comment.