New issue
Advanced search Search tips

Issue 918971 link

Starred by 1 user

Issue metadata

Status: Duplicate
Merged: issue 910727
Owner: ----
Closed: Jan 7
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Mac
Pri: 2
Type: Bug



Sign in to add a comment

onbeforeunload doesn't work correctly with "Warn Before Quitting"

Reported by jo...@figma.com, Jan 3

Issue description

UserAgent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.14; rv:64.0) Gecko/20100101 Firefox/64.0

Steps to reproduce the problem:
1. Enable "Warn Before Quitting" in the Chrome menu
2. Go to website that uses `onbeforeunload`
3. Press Command-Q twice

What is the expected behavior?
The browser to show a "Are you sure you want to close" dialog before doing anything else.

If the user choose "stay on page" for the browser window and the web page to still be shown normally.

What went wrong?
The browser hides the current window and *then* shows the "Are you sure you want to close" dialog.

If the user choose "stay on page" the page appears to still be running (it's still sending network requests), but it isn't shown anywhere, so there's no way for the user to interact with it.

Did this work before? N/A 

Does this work in other browsers? Yes

Chrome version: 71.0.3578.98  Channel: n/a
OS Version: OS X 10.14
Flash Version: 

This is a data-loss issue for us since if the user close our website with unsaved data, there's no way for the user to get back to the webpage to save the data before closing the page.

I.e. "onbeforeunload" exists to prevent users from losing data entered but not saved. Since it's not working it's easy for the user to accidentally lose such data.
 
Labels: Needs-Triage-M71
Cc: swarnasree.mukkala@chromium.org
Components: UI>Input>KeyboardShortcuts
Labels: Triaged-ET Needs-Feedback
Thanks for filing the issue...

@reporter: As mentioned in step#2 in comment#0, could you please provide a sample URL that uses 'onbeforeunload' so that it would be really helpful in triaging of the issue.
Test url: data:text/html,<html><input type=text onchange="window.onbeforeunload=()=>true">
Project Member

Comment 4 by sheriffbot@chromium.org, Jan 4

Labels: -Needs-Feedback
Thank you for providing more feedback. Adding the requester to the cc list.

For more details visit https://www.chromium.org/issue-tracking/autotriage - Your friendly Sheriffbot
Same testcase provided as an attachment with explicit instructions.
test2.html
218 bytes View Download
Mergedinto: 910727
Status: Duplicate (was: Unconfirmed)

Sign in to add a comment