I need to dispatch the window's load
event in Javascript. There is plenty of documentation on how to dispatch mouse events, But I can't find any on load events. It only needs to work in Firefox. It would be equally helpful if I could "spy" on the window's load event, because then I could just call the function. Using the "Event spy" addon isn't working because it requires me to open the dom inspector, which i can't do until after the page is finished loading.
I'm making a grease monkey script. So I don't know which function it is that I'm trying to invoke.
var load_event = document.createEvent('Event');
load_event.initEvent('load', false, false);
window.dispatchEvent(load_event);
works fine in my environment.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With