在Kiosk模式下检测Google Chrome [英] Detect Google Chrome in Kiosk Mode
问题描述
如何检测用户是否在Kiosk模式下使用Google Chrome?
我想知道用户是否在Kiosk模式下使用chrome,如果我不显示一条消息来放置教学,那么她可以使用只有kiosk模式可以提供
您可以检查 isKioskSession
属性 launchData
从 chrome获得的对象。 app.runtime.onLaunched 事件。
chrome.app.runtime.onLaunched.addListener(function(launchData){
if(launchData.isKioskSession){
// yes,we are in kiosk mode
}
});
编辑
以上答案假设您位于 Chrome应用程序。如果您试图检测页面是否位于使用--kiosk选项启动的Chrome浏览器中,我不知道检测该页面的方法。但是,这与在全屏模式下运行功能相当,您可以使用全屏API 进行检测。
var fullscreenEnabled = document.fullscreenEnabled || document.mozFullScreenEnabled || document.webkitFullscreenEnabled;
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
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;
这篇关于在Kiosk模式下检测Google Chrome的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!