Detect Google Chrome in Kiosk Mode

人盡茶涼 提交于 2019-12-12 11:14:29

问题


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


回答1:


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;


来源:https://stackoverflow.com/questions/18666522/detect-google-chrome-in-kiosk-mode

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!