Best way to detect browser closing/navigation to other page and do logout

前端 未结 4 905
夕颜
夕颜 2021-01-02 13:52

I am writing an application in GWT and I need to detect when a user navigates away from my application or when he closes the browser window (onUnload event) and do a logout

4条回答
  •  孤街浪徒
    2021-01-02 14:16

    Looks like GWT does have an event for exactly this.

    ClosingEvent.

    Looks like you need to implement a ClosingHandler

提交回复
热议问题