[Project_owners] setTimeout and Thunderbird under Mac OS X

Vadim Atlygin vadim.atlygin at gmail.com
Mon Nov 19 05:20:49 PST 2007


On Nov 19, 2007 1:52 AM, Michael Vincent van Rantwijk, MultiZilla
<mv_van_rantwijk at yahoo.com> wrote:
> Vadim Atlygin wrote:
> > Hi everybody,
> >    I'm developing an extension for Thunderbird and recently start
> > testing it on Mac OS X. The biggest issue I found is that code like
> >       window.setTimeout(function() {
> >                 //some code
> >               window.setTimeout(arguments.callee, 1000);
> >       }, 1000);
> >
> > is executed only once on Mac but works perfectly with Windows.
> Interesting, sound like a Mac only bug, but...
Well, I couldn't reproduce it under Linux or Windows, so...

> > setInterval doesn't work either.
> > I don't even know where should I look to make it work, maybe someone
> > had this problem before and know work around?
> > BTW, there is no errors in Error Console, so code is correct.
> This isn't in a binding or component?  I mean; I have seen bindings and
> components failing to throw errors, so make sure to add a try {}
> catch(ex) {} clause to see what goes wrong.  Just to be sure ;)

No, it's plain code and I've checked it with debugger as well.

> > Any comments would be appreciated.
> >
> > Best regards,
> > Vadim, developer of colorediffs extension.
> Have you tried to increase the interval to say 2000 or 5000 milliseconds
> because some platforms might be a lot quicker, too quick for your 1
> second delay.
Well, it still have to run the code, doesn't it? And it just skips the
second time for some reason.
> Also, you aren't changing |window| (which I would have checked anyways)
> accidentally?
That actually might be the problem.
You see, actually I have the following situation: I have a dialog
window and <browser/> element inside. I render some html code in
onload event handler and with Windows and Linux that works fine but
under Mac html content appear for a second and then just disappear for
no apparent reason. I thought I might just check if it is empty and
re-render it but then I ran into bug described earlier. Since I'm
getting my window as browser.contentWindow it might be just it, looks
like original window got lost inside Thunderbird somewhere with my
html content.

Anyway, since I'm not sure I can trace this down, is there another way
to set up timer events?

> --
> Michael Vincent van Rantwijk
> - MultiZilla Project Team Lead
> - XUL Boot Camp Staff member (ActiveState Training Partner)
> - iPhone Application Developer
> _______________________________________________
> Project_owners mailing list
> Project_owners at mozdev.org
> https://www.mozdev.org/mailman/listinfo/project_owners

More information about the Project_owners mailing list