Open Bug 501501 Opened 15 years ago Updated 2 years ago

setInterval/setTimeout aren't working anymore after alert()

Categories

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

defect

Tracking

()

People

(Reporter: christopher.blum, Assigned: smaug)

References

()

Details

(Keywords: testcase)

User-Agent:       Mozilla/5.0 (Windows; U; Windows NT 6.0; de; rv:1.9.1) Gecko/20090624 Firefox/3.5
Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 6.0; de; rv:1.9.1) Gecko/20090624 Firefox/3.5

Hi,

I found a bug which occures in Firefox 3 and 3.5 (on Mac Leopard and Windows Vista)
An alert message which is triggered by an ajax callback method causes setTimeout/setInterval to stop working in all following pages in the same tab.

How to reproduce this:
- Start an ajax request within an iframe
- Define a callback method which shows an alert() message if the readyState is "2" (loaded)
- When an user leaves the page before the ajax request has succeeded the readyState is for some reason "2" and therefore the alert message is shown
- On every following page setInterval/setTimeout don't working anymore (silently)
- Only a closing and reopening the tab fixes the problem

I prepared a test page:
First, go to the following page and click the link:
http://sendsome.org/dump/ffbug/setTimeout.php
You'll see that the setTimeout callback is triggered correctly.

Now go to the following page which contains an iframe that sends an ajax request which takes 5 seconds to finish:
http://sendsome.org/dump/ffbug/index.php

Click the link on the page within those 5 seconds. You'll see the mentioned alert() message and you'll be redirected to the setTimeout test-page. Now click the link again. It won't trigger the setTimeout callback even if you refresh the page and try again.

It only happens when the ajax request is started within the iframe.

This bug should not be underrated since a lot of web applications (e.g. OpenSocial Gadgets) run within an iframe and even more web applications are using setTimeout/setInterval (e.g. for doing fancy effects)

Reproducible: Always
This seems to be a duplicate of Bug 418493 and is caused by Bug 52209.
Assignee: general → nobody
Component: JavaScript Engine → DOM
QA Contact: general → general
I disagree, Ria.
I don't think that this is a duplicate of Bug 418493 since this has nothing to do with a timeout that is blocked by an alert.
The setTimeout in my example is initiated after the alert is closed.
Bent, I think this might have something to do with Sync XHR and timeouts.

(Btw, one can easily lock up the whole Safari with testcases similar to the one in this bug.)
This is similar to bug 497909 (which itself may be a dupe of bug 418493).
Oh, then it isn't what I was a bit afraid of.
Status: UNCONFIRMED → NEW
Ever confirmed: true
(In reply to comment #3)
> Bent, I think this might have something to do with Sync XHR and timeouts.
> 
> (Btw, one can easily lock up the whole Safari with testcases similar to the one
> in this bug.)

I am not using a synchronous xhr in my example.
Indeed, my mistake.
Could at least anyone confirm this bug?
Is there anything I can do to help you guys fixing that?

Thanks.
Flags: wanted1.9.2?
Flags: blocking1.9.2?
This is a very old regression, but we should fix this anyway.
Assignee: nobody → Olli.Pettay
Flags: blocking1.9.2?
Keywords: testcase
Version: unspecified → Trunk
I can reproduce the problem using Christopher's testcase with Firefox 4 beta 7.
This bug is causing a lot of problems for us as we have a lot of alerts in our application which are essential. Any other workarounds for this one?
Does this still happen on FF4?
Yep, happening on the latest nightlies as well.
In Firefox 4 beta 12 I cannot reproduce the problem anymore with the testcase from Christopher. Whether the actual problem has disappeared or just isn't trigger anymore (due to the new modal dialogs within the tabs?) I don't know.
Flags: wanted1.9.2?
Component: DOM → DOM: Core & HTML
Severity: normal → S3
You need to log in before you can comment on or make changes to this bug.