Here I am facing an issue with the code below I wrote to detect the browser's close event
to make user logged out
from website.
But unfortunately this event fires on Refresh
too :(.
Window.addWindowClosingHandler(new Window.ClosingHandler() {
public void onWindowClosing(Window.ClosingEvent closingEvent) {
closingEvent.setMessage("Do you really want to close the page?");
}
});
Yes, I gone through
GWT detect browser refresh in CloseHandler
But I didn't find any positive results there.
As per GWT Window.ClosingEvent class api:
Fired just before the browser window closes or navigates to a different site.
But I still have hope that we can detect browser refresh
.
Can any one give a hint regarding this?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…