Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is there a way to tell whether Safari is fullscreen? (e.g. document.fullscreenElement)

Tags:

People also ask

How do I tell if an element is fullscreen?

Tip: Use the element. requestFullscreen() method to view an element in fullscreen mode. Tip: Use the element. exitFullscreen() method to cancel fullscreen mode.

Which function is used for making the website fullscreen?

Full-screen can be activated for the whole browser window by pressing the F11 key. It can be exited by pressing the Esc button. It is also possible to make a specific element in the page to enter and exit full-screen mode programmatically using Javascript Fullscreen API.

What is fullscreen mode?

Full screen mode allows you to watch videos that take up your entire screen. Android ComputeriPhone & iPad. More.


I am trying to find out whether Safari is in fullscreen mode using Javascript. Chrome and Mozilla both use vendor-prefixed versions of document.fullscreenElement:

isFullscreen = function() {
  return document.fullscreenElement
      || document.webkitFullscreenElement
      || document.mozFullScreenElement;
}

However, this doesn't work on Safari 5.1.7 -- there is no "webkitFullscreenElement" or similar property on document.

Does anyone know if there's a way to tell whether Safari is in fullscreen mode?