This gist shows why we should avoid register to the window load
event inside a promise chain.
I encountered this bug at work, and this is the demostration of how to reproduce it.
Notice how the console.log
at line 19 of script.js
is never called,
and the console never prints Do something on load
.