Open Bug 1848014 Opened 3 years ago Updated 2 years ago

`warnOnTabsClosing` should be `async`

Categories

(Firefox :: Tabbed Browser, defect)

defect

Tracking

()

People

(Reporter: rkraesig, Unassigned, NeedInfo)

References

(Depends on 1 open bug)

Details

Currently, warnOnTabsClosing(), when it needs to warn, uses the synchronous interface provided by nsIPromptService. Unfortunately, this enters a nested modal loop (using SpinEventLoopUntil), which can lead to hangs. (See bug 1842170 for a concrete example.)

Fortunately, as of bug 1271842, nsIPromptService now also has an async interface which avoids creating a nested modal loop. Reworking warnOnTabsClosing() (and its callers and siblings) to be async would prevent this class of hangs.

Summary: `warnOnClosingTabs` should be `async` → `warnOnTabsClosing` should be `async`

Addendum after a bit of digging while investigating possible short-term workarounds: this is quite a bit of work that doesn't even mostly fall into Firefox :: Tabbed Browser, but I'm not sure what the right place is.

(The main architectural point seems to be the use of a DOM event handler [1a] [1b] to decide whether to close the window [2] [3].)

The severity field is not set for this bug.
:dao, could you have a look please?

For more information, please visit BugBot documentation.

Flags: needinfo?(dao+bmo)
You need to log in before you can comment on or make changes to this bug.