Fix initCustomEvent on Firefox.