Closed Bug 1711381 Opened 5 years ago Closed 5 years ago

A page spamming `prompt()` can trigger window prompts when the containing browser window goes away

Categories

(Toolkit Graveyard :: Notifications and Alerts, defect, P3)

Firefox 89
Desktop
All

Tracking

(firefox-esr78 unaffected, firefox88 disabled, firefox89 wontfix, firefox90 verified)

VERIFIED FIXED
90 Branch
Tracking Status
firefox-esr78 --- unaffected
firefox88 --- disabled
firefox89 --- wontfix
firefox90 --- verified

People

(Reporter: mystiquewolf, Assigned: Gijs)

References

(Blocks 1 open bug, Regression)

Details

(Keywords: regression, Whiteboard: [proton-modals])

Attachments

(3 files)

Attached file index.html

User Agent: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:88.0) Gecko/20100101 Firefox/88.0

Steps to reproduce:

  1. Open the file with a single tab in Firefox 89 Beta
  2. A prompt appears when the page loads. Do not confirm or close the prompt.
  3. Close the single tab while the prompt is open.

Actual results:

The browser closes. The prompt appears on its own window after the browser is closed.

Expected results:

The prompt should not appear at all after closing the browser.

Status: UNCONFIRMED → NEW
Has STR: --- → yes
Component: Untriaged → Notifications and Alerts
Ever confirmed: true
Keywords: regression
OS: Unspecified → All
Product: Firefox → Toolkit
Hardware: Unspecified → Desktop

Regression window:
https://hg.mozilla.org/integration/autoland/pushloghtml?fromchange=803c26c0927131a6e1fffc5ebdebb55e95161ce6&tochange=89c0c4d8d57ce6370cdd095ae1fbaa88031afb96

Regressed by Bug 1680066

Setting prompts.contentPromptSubDialog to false fixes the problem.
Bug 1702495 enabled the preference since firefox89.

Has Regression Range: --- → yes
Regressed by: 1680066, 1702495
Blocks: proton
Flags: needinfo?(gijskruitbosch+bugs)

This page infinite-loops if the prompt() doesn't return a name, so it's not the same prompt that's reshowing, it's the page showing a second (or third, or fourth, ...) identical prompt. You can also see this (but as "normal" prompts, not separate windowed ones) if you just cancel out of the prompt instead of closing the browser window.

Still looking at why the windowed prompt happens - it's kind of weird because the problem goes away when I attach a JS debugger...

Summary: On close of single tab with pending prompt() the prompt is displayed again after browser is closed → A page spamming `prompt()` can trigger window prompts when the containing browser window goes away
Whiteboard: [proton-cleanups]
Assignee: nobody → gijskruitbosch+bugs
Status: NEW → ASSIGNED
Flags: needinfo?(gijskruitbosch+bugs)
Priority: -- → P3
Pushed by gijskruitbosch@gmail.com: https://hg.mozilla.org/integration/autoland/rev/39c32384d7a9 correctly handle the browser no longer being present for content and tabmodal prompts, r=pbz
Whiteboard: [proton-cleanups] → [proton-modals]
See Also: → 1711740
Flags: needinfo?(gijskruitbosch+bugs)

With many thanks to Mike for helping me debug the strange test issues I was seeing (some of which got filed as 1711740). Try now appears happy: https://treeherder.mozilla.org/jobs?repo=try&revision=c543ecaef781c088bb0e2e9f2b882b0502f2ade1 so I'm relanding.

Pushed by gijskruitbosch@gmail.com: https://hg.mozilla.org/integration/autoland/rev/4d8229a81e8d correctly handle the browser no longer being present for content and tabmodal prompts, r=pbz
Status: ASSIGNED → RESOLVED
Closed: 5 years ago
Resolution: --- → FIXED
Target Milestone: --- → 90 Branch

This issue is Verified as fixed in our latest Nightly build 90.0a1 (2021-05-21) on Windows, Mac and Ubuntu.

Status: RESOLVED → VERIFIED
See Also: → 1718560
Product: Toolkit → Toolkit Graveyard
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: