Last active
March 27, 2019 08:42
-
-
Save w-jerome/ff9c0ffbb199dd531d569f7a2d0401f8 to your computer and use it in GitHub Desktop.
Javascript — Check if browser support fullscreen
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function canGoFullscreen() { | |
| var el = document.body; | |
| var check = typeof el.requestFullscreen !== 'undefined' || | |
| typeof el.mozRequestFullScreen !== 'undefined' || | |
| typeof el.webkitRequestFullscreen !== 'undefined' || | |
| typeof el.msRequestFullscreen !== 'undefined' || | |
| typeof document.exitFullscreen !== 'undefined' || | |
| typeof document.mozCancelFullScreen !== 'undefined' || | |
| typeof document.webkitExitFullscreen !== 'undefined'; | |
| return check; | |
| }; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment