浏览器关闭时如何自动注销用户? [英] How to automatically log out user when browser closes?

查看:396
本文介绍了浏览器关闭时如何自动注销用户?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个聊天程序,它取决于用户是否在线以继续聊天。所以我想知道,当他/她关闭整个浏览器时,有没有办法注销用户,而不仅仅是像Safari,IE或Google Chrome这样的一个窗口?

I have a chat program, which relies on whether the user is online or not to keep chatting. So I was wondering, is there a way to logout the user when he/she closes the WHOLE browser, not just the one window in like say, Safari, IE or Google Chrome?

推荐答案

没有任何可用的JavaScript可用于检测全部浏览器退出。如果您需要在浏览器完全退出时收到通知(即使定义这将是非简单的),请考虑开发浏览器扩展。

There's nothing available via JavaScript which can be used to detect "WHOLE browser" exits. If you need to be notified when a browser has completely exited (even defining this would be non-simplistic), consider developing browser extensions.

这篇关于浏览器关闭时如何自动注销用户?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆