From document.createEvent
The createEvent method is deprecated. Use event constructors instead.
In bootstap.js
// this works
let event = window.document.createEvent('Event');
event.initEvent('main-unload',false,false);
window.dispatchEvent(event);
// this doesn't work
let event = new CustomEvent('main-unload', {"detail":{"hazcheeseburger":true}});
window.dispatchEvent(event);
//Console error: 1404023846296 addons.xpi WARN Exception running bootstrap method shutdown on ***addon-id****
What am I missing?
addEventListener. Check out this topic: How to listen to custom events on all windows, bubbling issue? - Noitidartbootstrap.js, overlay script, etc.) wants to listen to events dispatched by an unprivileged website, so it doesn't really apply here. - nmaierstartup/shutdownin try-catch blocks thatCu.reportErrorany exceptions. Makes it easier to figure out what code is broken. The regualaraddons.xpi WARNmessage is not really helpful in that regard. - nmaier