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

Fix #7796, Fix #6966: Use webViewDidClose to handle window.close #7797

Merged
merged 1 commit into from
Jul 28, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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