use a WindowCloseListener.
> I need that to detect when user navigates away from the page, but does
> not close the browser.
This is not possible in JavaScript, there's only an 'unload' event, no
'close' event or similar.
> I have written a native implementation, but are there any plans to add
> Window.addUnloadListener() functionality?
> Or am I missing something?
Window.addWindowCloseListener *is* relying on beforeunload and unload
events.