简体   繁体   中英

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. Is there a way I can find out if it's running in kiosk-mode or in normal fullscreen/windowed-mode?

Here's a snippet from my manifest.json if it's any help

{
    "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.

So:

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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