Is there any way to detect if the browser window is in full-screen mode via javascript? I’ve been googling this and not getting much luck. Found one function that doesn’t work, the rest are just posts where a person asks this question and then others tell them how to do something without needing to detect if browser’s in fullscreen mode.
I have a requirement to do this. If a user w/ a certain role is not in fullscreen mode, I need to kick them out of the application (used internally, and no, I cannot change this business rule)
Any help would be appreciated. Thanks.
The code that didn’t work (always returns false):
[code]
function is_fullscreen()
{
return window.outerWidth == screen.width && window.outerHeight == screen.height;
}