[Project_owners] setTimeout and Thunderbird under Mac OS X

Michael Vincent van Rantwijk, MultiZilla mv_van_rantwijk at yahoo.com
Mon Nov 19 07:59:30 PST 2007

Vadim Atlygin wrote:

<snip />

>> 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?

Yes (in components/add-ons) just take a look at: nsITimer.idl

Here's an example:

const Cc = Components.classes;
const Ci = Components.interfaces;
this.mTimer = Cc["@mozilla.org/timer;1"].createInstance(Ci.nsITimer);
this.mTimer.init(this, refreshDelay, Ci.nsITimer.TYPE_ONE_SHOT);

observe: function(aSubject, aTopic, aData) {
   case: "timer-callback"

// or Ci.nsITimer.TYPE_REPEATING_SLACK or 

Michael Vincent van Rantwijk
- MultiZilla Project Team Lead
- XUL Boot Camp Staff member (ActiveState Training Partner)
- iPhone Application Developer

More information about the Project_owners mailing list