fix: beforeunload and unload firing in BrowserViews (#28382)
* fix: beforeunload and unload firing in BrowserViews * Ensure UserGesture is sent for BV webContents * spec: add tests * refactor: clean up logic * spec: fixup specs * docs: document event behavior for BrowserViews
This commit is contained in:
parent
e454bded3c
commit
7d04f729d8
4 changed files with 56 additions and 9 deletions
|
@ -1120,7 +1120,8 @@ content::WebContents* WebContents::OpenURLFromTab(
|
|||
void WebContents::BeforeUnloadFired(content::WebContents* tab,
|
||||
bool proceed,
|
||||
bool* proceed_to_fire_unload) {
|
||||
if (type_ == Type::kBrowserWindow || type_ == Type::kOffScreen)
|
||||
if (type_ == Type::kBrowserWindow || type_ == Type::kOffScreen ||
|
||||
type_ == Type::kBrowserView)
|
||||
*proceed_to_fire_unload = proceed;
|
||||
else
|
||||
*proceed_to_fire_unload = true;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue