Skip to content
This repository has been archived by the owner on May 10, 2024. It is now read-only.

Commit

Permalink
Fix #7796, Fix #6966: Use webViewDidClose to handle window.close (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
kylehickinson committed Jul 28, 2023
1 parent 8a4e183 commit e720c18
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 e720c18

Please sign in to comment.