Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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
}
like image 702
Rasmus Avatar asked Sep 15 '25 14:09

Rasmus


1 Answers

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
});
like image 176
Ben Fortune Avatar answered Sep 18 '25 04:09

Ben Fortune