Ways to detect CTRL-N or when a user opens a new window

后端 未结 6 1431
醉酒成梦
醉酒成梦 2020-12-22 12:52

How can we detect when a user opens a new window. The user is already authenticated and we make heavy use of sessions.

We were trying to avoid Ctrl+

6条回答
  •  轻奢々
    轻奢々 (楼主)
    2020-12-22 13:32

    You could possibly put a window count into the session and increment it on window.onload and decrement it on window.onunload.

    Imagine me tutting, sucking air through my teeth and going "better you than me, guvna" if you use that, though.

提交回复
热议问题