Window reload event?


#1

What’s the appropriate event to listen to for a window reload?

I’ve tried a number of options such as dom-ready which does trigger when the window is created, but not when the window is manually reloaded with CMD+R.

I’ve also tried devtools-reload-page with no success.


#2

+1

I am also having trouble figuring which event I should listen for a window reload.

I am spawning multiple processes and need to kill these processes before the reload event otherwise they all throw exceptions since about the PORT already being used.


#3

You can listen to the beforeunload dom event, which is triggered when a window is being closed and when a window is being reloaded. It’s mentioned in the docs for the close event.