Content-modal alert() dialog gets aborted with exception "prompt aborted by user", when I drag its tab between windows




8 years ago
5 years ago


(Reporter: dholbert, Unassigned)



Firefox Tracking Flags

(Not tracked)



(1 attachment)



8 years ago
Created attachment 538593 [details]

 1. Load testcase in a window with at least 2 open tabs.
 2. Click page (to trigger alert)
 3. Drag tab off of window (or between windows)

EXPECTED RESULTS: The alert should remain until user actually dismisses it.

ACTUAL RESULTS: The alert disappears, and this exception is thrown (& caught by my testcase & appended to innerHTML):
[Exception... "prompt aborted by user" nsresult: "0x80040111 (NS_ERROR_NOT_AVAILABLE)" location: "JS frame :: resource:///components/nsPrompter.js :: openTabPrompt :: line 462" data: no]

That points to this line:
Hmm, interesting! I don't think we ever considered this when implementing the tab-modal prompts. The basic issue is that the prompt is part of chrome, not content, and so the magic stuff we do with detaching/reattaching docshells for detaching tabs doesn't even know about the prompt. This might be quite tricky to fix, as I suspect the call stack entrains certain things specific to the tab prompt originally shown.

We might want to consider a workaround of just not allowing tab-detach when the tab is showing a prompt.
Component: General → General
Product: Firefox → Toolkit
QA Contact: general → general
Hmm, we might also be able to get away with having nsPrompter detect this, and simply show a new prompt (retaining any state from the old one) before returning to content. Could confuse an addon that's fiddling with prompts, but I'd suspect that's quite rare (and would be broken by tab-detach in general, anyway).

Comment 3

7 years ago
What do you want to do here?

(In reply to Justin Dolske [:Dolske] from comment #1)
> We might want to consider a workaround of just not allowing tab-detach when
> the tab is showing a prompt.

If we consider this acceptable, is there a boolean flag that indicates whether a tab is showing a prompt?
Bulk move to Toolkit::Notifications and Alerts

Filter on notifications-and-alerts-component.
Component: General → Notifications and Alerts
You need to log in before you can comment on or make changes to this bug.