htmlWindowOnClose function
Setup a callback action
on browser unload
Implementation
void htmlWindowOnClose(Function action) {
html.window.onBeforeUnload.listen((event) async => action());
html.window.onUnload.listen((event) async => action());
}