Fix typo: handle DOMContentLoaded events correctly

This commit is contained in:
YUKI Hiroshi 2015-05-11 18:48:27 +09:00
parent 0c2c33e19d
commit 94428a1b2d

View File

@ -1,7 +1,7 @@
(function() { (function() {
/** /**
* On secondary (and later) window, SSWindowStateBusy event can be fired * On secondary (and later) window, SSWindowStateBusy event can be fired
* before DOMContentLoad, on "domwindowopened". * before DOMContentLoaded, on "domwindowopened".
*/ */
var SSWindowStateBusyListener = function TSTSSWindowStateBusyListener(aEvent) { var SSWindowStateBusyListener = function TSTSSWindowStateBusyListener(aEvent) {
window.removeEventListener(aEvent.type, TSTSSWindowStateBusyListener, false); window.removeEventListener(aEvent.type, TSTSSWindowStateBusyListener, false);
@ -9,8 +9,8 @@
SSWindowStateBusyListener = undefined; SSWindowStateBusyListener = undefined;
}; };
window.addEventListener('SSWindowStateBusy', SSWindowStateBusyListener, false); window.addEventListener('SSWindowStateBusy', SSWindowStateBusyListener, false);
window.addEventListener('DOMContentLoad', function onDOMContentLoad(aEvent) { window.addEventListener('DOMContentLoaded', function onDOMContentLoaded(aEvent) {
window.removeEventListener(aEvent.type, onDOMContentLoad, false); window.removeEventListener(aEvent.type, onDOMContentLoaded, false);
if (SSWindowStateBusyListener) { if (SSWindowStateBusyListener) {
window.removeEventListener('SSWindowStateBusy', TSTSSWindowStateBusyListener, false); window.removeEventListener('SSWindowStateBusy', TSTSSWindowStateBusyListener, false);
SSWindowStateBusyListener = undefined; SSWindowStateBusyListener = undefined;