shell.js
function tryFullscreen(shell) {
  //Request full screen
  var elem = shell.element
  
  if(shell._wantFullscreen && !shell._fullscreenActive) {
    var fs = elem.requestFullscreen ||
             elem.requestFullScreen ||
             elem.webkitRequestFullscreen ||
             elem.webkitRequestFullScreen ||
             elem.mozRequestFullscreen ||
             elem.mozRequestFullScreen ||
             function() {}
    fs.call(elem)
  }
  if(shell._wantPointerLock && !shell._pointerLockActive) {
    var pl =  elem.requestPointerLock ||
              elem.webkitRequestPointerLock ||
              elem.mozRequestPointerLock ||
              elem.msRequestPointerLock ||
              elem.oRequestPointerLock ||
              function() {}
    pl.call(elem)
  }
}
function tryFullscreen(shell) {
  //Request full screen
  var elem = shell.element
  
  if(shell._wantFullscreen && !shell._fullscreenActive) {
    var fs = elem.requestFullscreen ||
             elem.requestFullScreen ||
             elem.webkitRequestFullscreen ||
             elem.webkitRequestFullScreen ||
             elem.mozRequestFullscreen ||
             elem.mozRequestFullScreen ||
             function() {}
    fs.call(elem)
  }
  if(shell._wantPointerLock && !shell._pointerLockActive) {
    var pl =  elem.requestPointerLock ||
              elem.webkitRequestPointerLock ||
              elem.mozRequestPointerLock ||
              elem.msRequestPointerLock ||
              elem.oRequestPointerLock ||
              function() {}
    pl.call(elem)
  }
}
function tryFullscreen ( shell ) { //Request full screen var elem = shell . element if ( shell . _wantFullscreen && ! shell . _fullscreenActive ) { var fs = elem . requestFullscreen || elem . requestFullScreen || elem . webkitRequestFullscreen || elem . webkitRequestFullScreen || elem . mozRequestFullscreen || elem . mozRequestFullScreen || function ( ) { } fs . call ( elem ) } if ( shell . _wantPointerLock && ! shell . _pointerLockActive ) { var pl = elem . requestPointerLock || elem . webkitRequestPointerLock || elem . mozRequestPointerLock || elem . msRequestPointerLock || elem . oRequestPointerLock || function ( ) { } pl . call ( elem ) } }
Fullscreen state toggle
Fullscreen state toggle