Closed Bug 389988 Opened 17 years ago Closed 17 years ago

showModalDialog should return null instead of throwing when blocked as an unwanted popup

Categories

(Core :: DOM: Core & HTML, defect, P4)

defect

Tracking

()

RESOLVED FIXED

People

(Reporter: ventnor.bugzilla, Assigned: Waldo)

References

Details

Attachments

(1 file)

When the popup blocker blocks a modal dialog, it will return NS_ERROR_FAILURE rather than NS_OK, because showModalDialog doesn't tell OpenInternal to do the "JS fixups".

This means that an exception is thrown in Javascript. Bad.

We need to make a script-safe version of ShowModalDialog() like we did with Open(), so it will not throw if our popup blocker blocks it.
Flags: blocking1.9?
Assignee: nobody → jwalden+bmo
Status: NEW → ASSIGNED
Attachment #274316 - Flags: superreview?(jst)
Attachment #274316 - Flags: review?(jst)
Attachment #274316 - Flags: superreview?(jst)
Attachment #274316 - Flags: superreview+
Attachment #274316 - Flags: review?(jst)
Attachment #274316 - Flags: review+
I think we should just pass PR_TRUE for aDoJSFixups.  I don't see what problems it would cause that can't also be caused by modal window.open...

I guess we can do that in a followup bug, though.  But make sure one is filed?
Summary: showModalDialog is not script-safe → showModalDialog should return null instead of throwing when blocked as an unwanted popup
Blocks: 390186
Blocking on making us match what IE does in these situations (which someone would need to check on).
Flags: blocking1.9? → blocking1.9+
We can deal with the remaining issues in the followup bug; I'm not entirely sure why I didn't close this when I committed the fix, to be honest.
Status: ASSIGNED → RESOLVED
Closed: 17 years ago
Resolution: --- → FIXED
Somehow I think I forgot to get a followup bug filed; that's bug 437361 now.
Maybe I was unclear.  I think this patch was the wrong thing to do: we _do_ want to throw some exceptions from here to the calling script if they happen down below, imo.
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: