Skip to content

Instantly share code, notes, and snippets.

@lpirir
Created March 17, 2012 23:20
Show Gist options
  • Save lpirir/2066418 to your computer and use it in GitHub Desktop.
Save lpirir/2066418 to your computer and use it in GitHub Desktop.
Javascript code to show full screen browser
var docElm = document.documentElement;
if (docElm.requestFullscreen) {
docElm.requestFullscreen();
}
else if (docElm.mozRequestFullScreen) {
docElm.mozRequestFullScreen();
}
else if (docElm.webkitRequestFullScreen) {
docElm.webkitRequestFullScreen();
}
@Geoneer
Copy link

Geoneer commented Sep 10, 2017

Failed to execute 'requestFullscreen' on 'Element': API can only be initiated by a user gesture.

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