Closed Bug 688948 Opened 13 years ago Closed 6 years ago

Make initial load event handling be more sane

Categories

(Toolkit :: Add-ons Manager, defect)

defect
Not set
normal

Tracking

()

RESOLVED INACTIVE

People

(Reporter: Unfocused, Unassigned)

Details

Bug 591801 made initialize() be called from the load event from anything in the document (rather than the window)... which works, but is also kinda a crazy hack. Which in turn needed another hack to unbreak after bug 185236.



Quoting bug 591801 comment 25:
> > >-window.addEventListener("load",  initialize, false);
> > ...
> > >+document.addEventListener("load", initialize, true);
> > 
> > Curious: why this change?
> 
> Oh yeah, so the test harness wasn't working properly with the add-ons
> manager opening in a new window. The load event listener in head.js was
> getting called before initialize. It seems that switching to a capturing
> document load listener makes initialize get called earlier than anything
> registered on the window.



Quoting bug 591801 comment 29:
> There are no load events on documents.
> 
> This capturing listener is firing whenever anything in the page loads.  In
> particular, it seems to fire when the first <xul:image> in the document
> finishes loading.
> 
> I'm going to add a hack to this code in bug 185236 to avoid also firing on
> stylesheet loads, but this code just looks wrong to me...



Quoting bug 185236 comment 53:
> > Would it be worthwhile to change the event to DOMContentLoaded then?
> 
> Possibly.  I really have no idea what that code was trying to do, so I'm
> trying to just change it as little as possible in this bug, and I asked
> about it in the bug that introduced the code.
> 
> Using DOMContentLoaded would certainly not trigger from the CSS load event,
> but might still fire "too early" for the addons manager...
Per policy at https://wiki.mozilla.org/Bug_Triage/Projects/Bug_Handling/Bug_Husbandry#Inactive_Bugs. If this bug is not an enhancement request or a bug not present in a supported release of Firefox, then it may be reopened.
Status: NEW → RESOLVED
Closed: 6 years ago
Resolution: --- → INACTIVE
You need to log in before you can comment on or make changes to this bug.