开发者

Is it possible to tell if a user has my page minimized or the inactive tab?

I am messing around with some web pages and was wondering if it is possible to tell if my page is not the active page on a web browser. I am looking to tell if my page is minimized or is not the current tab. I am not asking about a particular language, but more just wondering if it is possible to get this s开发者_StackOverflow社区ort of information.


Yes, its totally possible, with javascript.

See these answers:

Determine whether webpage has foreground window focus/is active tab?

How to tell if browser/tab is active

Is there a way to detect if a browser window is not currently active?


You can check it with Javascript and then send a message to the server. But since the user can alter/disable the script you can never know for sure.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜