Skip to content

Instantly share code, notes, and snippets.

@robnyman
Last active June 22, 2018 18:36
Show Gist options
  • Star 3 You must be signed in to star a gist
  • Fork 2 You must be signed in to fork a gist
  • Save robnyman/1705463 to your computer and use it in GitHub Desktop.
Save robnyman/1705463 to your computer and use it in GitHub Desktop.
Fullscreen API, cancelling
if (document.exitFullscreen) {
document.exitFullscreen();
}
else if (document.mozCancelFullScreen) {
document.mozCancelFullScreen();
}
else if (document.webkitCancelFullScreen) {
document.webkitCancelFullScreen();
}
else if (document.msExitFullscreen) {
document.msExitFullscreen();
}
@dstorey
Copy link

dstorey commented Dec 13, 2013

IE11 supports the Fullscreen API now, with the ms prefix. I’ve created a fork that includes it, but I don’t see pull requests on Gists. Would be nice to include it here and in your article.

@huangguozhen
Copy link

Firefox 50.1.0 for Ubuntu can't work。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment