简体   繁体   English

在Kiosk模式下检测Google Chrome

[英]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 我想知道用户是否在自助服务终端模式下使用chrome,如果不是我显示消息进行教学,那么她可以使用只有自助服务终端模式可以提供的资源

You can check the isKioskSession property on the launchData object you get from the chrome.app.runtime.onLaunched event. 您可以检查从chrome.app.runtime.onLaunched事件获得的launchData对象上的isKioskSession属性。

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 . 以上答案假设您使用的是Chrome应用 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. 如果您尝试检测某个网页是否位于使用--kiosk选项启动的Chrome浏览器中,我不知道如何检测该页面。 However, this is functionally equivalent to running in fullscreen mode, which you can detect with the Fullscreen API . 但是,这在功能上等同于在全屏模式下运行,您可以使用Fullscreen API进行检测。

var fullscreenEnabled = document.fullscreenEnabled || document.mozFullScreenEnabled || document.webkitFullscreenEnabled;

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM