简体   繁体   English

Chrome打包应用 - 了解是否以自助服务终端模式运行

[英]Chrome packaged app - find out if running in kiosk-mode

I'm creating an application that can be run both in kiosk mode and normally (like, open from Chrome browser) but certain features should only be allowed to run in kiosk mode. 我正在创建一个既可以在kiosk模式下运行也可以正常运行的应用程序(例如,从Chrome浏览器打开),但某些功能应该只允许在自助服务终端模式下运行。 Is there a way I can find out if it's running in kiosk-mode or in normal fullscreen/windowed-mode? 有没有办法让我知道它是在kiosk模式还是在普通的全屏/窗口模式下运行?

Here's a snippet from my manifest.json if it's any help 这是我的manifest.json中的一个片段,如果有任何帮助的话

{
    "manifest_version": 2,
    "kiosk_enabled": true,
    "kiosk_only": false
}

From the documentation: 从文档:

To determine whether the app is being run in a regular session or Single App Kiosk Mode, you can inspect the isKioskSession boolean that's included in the launchData object from the app.runtime.onLaunched event. 要确定应用程序是在常规会话还是单应用程序Kiosk模式下运行,您可以从app.runtime.onLaunched事件中检查launchData对象中包含的is​​KioskSession布尔值。

So: 所以:

chrome.app.runtime.onLaunched.addListener(function(launchData) {
    launchData.isKioskSession; //true or false
});

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

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