Closed Bug 1666670 Opened 5 years ago Closed 5 years ago

beforeunload doesn't prevent closing a tab (or window, or quitting Firefox)

Categories

(Core :: DOM: Navigation, defect, P2)

defect

Tracking

()

VERIFIED FIXED
83 Branch
Tracking Status
firefox-esr78 --- unaffected
firefox80 --- unaffected
firefox81 --- unaffected
firefox82 --- unaffected
firefox83 + verified

People

(Reporter: agashlin, Assigned: kmag)

References

(Regression)

Details

(Keywords: dataloss, regression)

Attachments

(2 files)

Attached file unloadtest.html

STR:

  1. Navigate to the attached page (just sets up a beforeunload listener with preventDefault)
  2. Click somewhere in the client area to allow it to prevent nagivation
  3. Close the tab

Expected:

"This page is asking you to confirm..." dialog appears, preventing the tab from closing.

Actual:

Dialog appears, but before any interaction (~1 sec) the tab closes anyway.

Seen on Windows 10 64 bit, with a clean profile.

Regression range from mozregression:

Last good revision: c0db57c7f9f0d7df1fcb3e7afcd823256c9bbe6b
First bad revision: 091a4043d78af274fd5639829f17e4195d262e4a
Pushlog:
https://hg.mozilla.org/integration/autoland/pushloghtml?fromchange=c0db57c7f9f0d7df1fcb3e7afcd823256c9bbe6b&tochange=091a4043d78af274fd5639829f17e4195d262e4a

This seems to point to bug 1655866, which involves beforeunload.

(apologies if I've misunderstood and this is now intended)

Flags: needinfo?(kmaglione+bmo)
Severity: -- → S2
Priority: -- → P2

[Tracking Requested - why for this release]:
This also affects quitting or closing the entire window, and some of our users' web apps will be relying on these prompts to prevent user dataloss. We shouldn't ship with this.

Keywords: dataloss
Summary: beforeunload doesn't prevent closing a tab → beforeunload doesn't prevent closing a tab (or window, or quitting Firefox)
Assignee: nobody → kmaglione+bmo
Flags: needinfo?(kmaglione+bmo)

Not a Fission-only issue.

Status: NEW → ASSIGNED
Fission Milestone: ? → ---
Pushed by maglione.k@gmail.com: https://hg.mozilla.org/integration/autoland/rev/6cf959e2de7b Fix beforeunload timeout handling to ignore prompt. r=mconley

There's no plausible way that WPT failure was caused by my patch.

Flags: needinfo?(kmaglione+bmo)
Pushed by maglione.k@gmail.com: https://hg.mozilla.org/integration/autoland/rev/290e7f47eed9 Fix beforeunload timeout handling to ignore prompt. r=mconley
Status: ASSIGNED → RESOLVED
Closed: 5 years ago
Resolution: --- → FIXED
Target Milestone: --- → 83 Branch

Reproduced the initial issue in Nightly 83.0a1 (build id: 20200922094538) using Windows 10.
Verified - Fixed in latest Nightly 84.0a1 (2020-10-22) and Beta 83.0b3 (build id: 20201022171613) on Windows 10 and Ubuntu 18.04.

Status: RESOLVED → VERIFIED
Flags: qe-verify+
Has Regression Range: --- → yes
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: