Open Bug 655181 Opened 13 years ago Updated 11 months ago

modal dialog (e.g. via window.alert()) opened with meta refresh tag refresh page in background causes this uncaught exception: "prompt aborted by user" .. resource://gre/components/nsPrompter.js

Categories

(Toolkit :: Content Prompts, defect)

x86
Linux
defect

Tracking

()

UNCONFIRMED

People

(Reporter: cyberrian, Unassigned)

References

Details

Attachments

(1 file)

User-Agent:       Mozilla/5.0 (X11; Linux i686; rv:2.0.1) Gecko/20100101 Firefox/4.0.1
Build Identifier: Mozilla/5.0 (X11; Linux i686; rv:2.0.1) Gecko/20100101 Firefox/4.0.1

Have a meta refresh tag refresh the page after X seconds. Before X seconds has elapsed, open a modal dialog e.g. via window.alert() and leave it open. After X seconds have elapsed, Firebug will throw this exception:
uncaught exception: [Exception... "prompt aborted by user"  nsresult: "0x80040111 (NS_ERROR_NOT_AVAILABLE)"  location: "JS frame :: resource://gre/components/nsPrompter.js :: openTabPrompt :: line 468"  data: no]

On other non-Firefox4 browsers, the meta refresh tag will only refresh the page after the modal dialog is dismissed e.g. when user clicks Cancel or OK. On Firefox4, the page refreshes even though the modal dialog is active.

Reproducible: Always

Steps to Reproduce:
1. Set up webpage with meta refresh tag for 10 seconds and a button to invoke a window.alert("test") modal dialog
2. Launch the webpage and immediately click on the button before 10 seconds
3. The "test" modal dialog should appear; wait for at least 10 seconds without dismissing the modal dialog.

Actual Results:  
After 10 seconds, the page refreshes, dismissing the modal dialog and triggering the uncaught exception specified in the above "Details" section. 

Expected Results:  
As long as the modal dialog is visible and the user has not dismissed it by clicking OK, the page should remain and not refresh automatically by the meta refresh tag. Most importantly, an uncaught exception should not be thrown.

I tested with various platforms including Ubuntu Linux, Windows XP, and Windows 7 and the problem doesn't seem to be platform dependent. Firefox 4 on any platform exhibits this bug.
Depends on: 59314
Version: unspecified → 4.0 Branch
Just to confirm, does this still happen if you go into about:config and switch prompts.tab_modal.enabled to false?
(In reply to comment #1)
> Just to confirm, does this still happen if you go into about:config and
> switch prompts.tab_modal.enabled to false?

The error goes away but the page still refreshes in the background because of the meta refresh. In other browsers e.g. IE and Chrome, the page will not refresh until the dialog is dismissed. I believe this is also FF 3.x's behavior but I don't have a system with FF 3.x installed now to confirm.
Product: Firefox → Toolkit
QA Contact: general → general
Version: 4.0 Branch → Trunk
ff27.0.1
17:53:32.956 NS_ERROR_NOT_AVAILABLE: prompt aborted by user nsPrompter.js:440
the titlebar says "Source of: jar:file:///C:/Program%20Files%20(x86)/Mozilla%20Firefox/omni.ja!/components/nsprompter.js - Mozilla Firefox"

the source code I see (from debugger) is
if (args.promptAborted)
            throw Components.Exception("prompt aborted by user", Cr.NS_ERROR_NOT_AVAILABLE);
    } finally {
        // If the prompt unexpectedly failed to invoke the callback, do so here.
        if (!callbackInvoked)
            onPromptClose(true);
    }


so I cannot debug my page because now debugger is completely broken because of this, happens when I refresh the page with alert() box up.
Attached file test_alert_refresh.html (deleted) —
Bulk move to Toolkit::Notifications and Alerts

Filter on notifications-and-alerts-component.
Component: General → Notifications and Alerts
This bug mainly effects developers trying to debug, disallowing them from seeing the alert before a page refresh, back button press, or form submit, etc. It can be circumvented by setting prompts.tab_modal.enabled = false in about:config. This will at least allow one to view the alert, but won't stop the refresh.
Severity: normal → S3
Component: Notifications and Alerts → Content Prompts
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: