feat: add webContents.close() (#35509)

* feat: add webContents.close()

* update docs, add test for beforeunload override

* Update web-contents.md
This commit is contained in:
Jeremy Rose 2022-09-16 16:22:59 -07:00 committed by GitHub
parent 994834d25a
commit eebf34cc6c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 110 additions and 1 deletions

View file

@ -134,6 +134,7 @@ BrowserWindow::~BrowserWindow() {
api_web_contents_->RemoveObserver(this);
// Destroy the WebContents.
OnCloseContents();
api_web_contents_->Destroy();
}
}
@ -181,7 +182,6 @@ void BrowserWindow::WebContentsDestroyed() {
void BrowserWindow::OnCloseContents() {
BaseWindow::ResetBrowserViews();
api_web_contents_->Destroy();
}
void BrowserWindow::OnRendererResponsive(content::RenderProcessHost*) {