We recently faced an issue with the WindowLoad event being triggered twice by an SPA which somehow dispatched native window.onload event twice. This is rare but possible and it causes issues in particular for how we inject data into the content page (e.g. custom scripts duplicated....). I have added a { once: true } option to the registration of the event on native window load, which prevents this issue.
Further, we felt it may be useful to be able to trigger events/messages on the 'domcontentloaded' event as well as full page load - this will hopefully allow for increase in perceived performance in many circumstances (alternative would be to trigger many processes on the AppBootedEvent which we may still do although this could clearly lead to problems with message registration etc.
We recently faced an issue with the
WindowLoad
event being triggered twice by an SPA which somehow dispatched nativewindow.onload
event twice. This is rare but possible and it causes issues in particular for how we inject data into the content page (e.g. custom scripts duplicated....). I have added a{ once: true }
option to the registration of the event on native window load, which prevents this issue.Further, we felt it may be useful to be able to trigger events/messages on the 'domcontentloaded' event as well as full page load - this will hopefully allow for increase in perceived performance in many circumstances (alternative would be to trigger many processes on the
AppBootedEvent
which we may still do although this could clearly lead to problems with message registration etc.