Last Comment Bug 376610 - "load" event on Messenger Window fired twice (Mac OS X only)
: "load" event on Messenger Window fired twice (Mac OS X only)
Status: RESOLVED FIXED
[jm-ex]
:
Product: Thunderbird
Classification: Client Software
Component: Mail Window Front End (show other bugs)
: 2.0
: PowerPC Mac OS X
-- normal (vote)
: ---
Assigned To: Nobody; OK to take it and work on it
:
:
Mentors:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2007-04-05 08:29 PDT by Patrick Brunschwig
Modified: 2015-09-12 06:07 PDT (History)
5 users (show)
See Also:
Crash Signature:
(edit)
QA Whiteboard:
Iteration: ---
Points: ---


Attachments

Description User image Patrick Brunschwig 2007-04-05 08:29:12 PDT
Found on TB version 2.0.0.0 (20070326):

In Enigmail I have an overlay to mailWindowOverlay.xul. That overlay contains the following Javascript line (not in any specific function, i.e. directly executed after the JS is loaded).

window.addEventListener("load",   enigMessengerStartup, false);

Now I see in Mac OS X that enigMessengerStartup() is called twice when Thunderbird starts. And not only that it's called twice: when called for the first time it seems that some of the XUL elements are not yet there. Specifically,

document.getElementById("messagepane")

returns NULL on the first call, but works OK on the 2nd call. Of course I can work around it easily, but it means that any extension listening to the window.load event will have to work around it as well...
Comment 1 User image Scott MacGregor 2007-04-05 10:03:30 PDT
hmm, I wonder if the hidden window is firing an onload event?
Comment 2 User image Phil Ringnalda (:philor) 2007-04-05 21:57:49 PDT
It certainly should, since it expects to disable menu items from its onload handler.

Do we want to have most of mailWindowOverlay.xul be message(s)WindowOverlay.xul? We certainly could, have just a stripped down mailWindowOverlay.xul that overlays every single window (gaining things like having DOMi work when the addressbook is frontmost), and put the message content stuff in a separate overlay that people only interested in mail could attach themselves to instead.
Comment 3 User image Wayne Mery (:wsmwk, NI for questions) 2015-09-12 05:13:47 PDT
Patrick, still an issue?
Comment 4 User image Patrick Brunschwig 2015-09-12 06:06:40 PDT
No, this must have been fixed years ago...

Note You need to log in before you can comment on or make changes to this bug.