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

Upvotes: 7

Views: 5582

Answers (1)

Sarah Elan
Sarah Elan

Reputation: 2461

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;

Upvotes: 10

Related Questions