Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Detect Google Chrome in Kiosk Mode

how to detect if the user using Google Chrome in kiosk mode?

I want to know if the user is using chrome in kiosk mode if it is not for me to display a message to put teaching so she can use the resources that only the kiosk mode can provide

like image 226
Witalo Da Luz Rebouças Avatar asked Sep 06 '13 21:09

Witalo Da Luz Rebouças


1 Answers

You can check the isKioskSession property on the launchData object you get from the chrome.app.runtime.onLaunched event.

chrome.app.runtime.onLaunched.addListener(function(launchData) {
  if (launchData.isKioskSession) {
      // yes, we are in kiosk mode
  }
});

EDIT

The above answer assumes that you are in a Chrome app. If you are trying to detect whether a page is in a Chrome browser launched with the --kiosk option, I don't know of a way to detect that. However, this is functionally equivalent to running in fullscreen mode, which you can detect with the Fullscreen API.

var fullscreenEnabled = document.fullscreenEnabled || document.mozFullScreenEnabled || document.webkitFullscreenEnabled;
like image 200
Sarah Elan Avatar answered Sep 30 '22 14:09

Sarah Elan