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.
精彩评论