diff --git a/custom_components/browser_mod/browser_mod.js b/custom_components/browser_mod/browser_mod.js index 70de728..d7ff28d 100644 --- a/custom_components/browser_mod/browser_mod.js +++ b/custom_components/browser_mod/browser_mod.js @@ -1264,7 +1264,7 @@ var pjson = { X Fullscreen - Motion/occupancy tracker x Information about interaction requirement - - Information about fullykiosk + x Information about fullykiosk - Commands x Rename browser_mod commands to browser_mod services x Framework diff --git a/custom_components/browser_mod/browser_mod_panel.js b/custom_components/browser_mod/browser_mod_panel.js index 7d50dc0..0dfb7fe 100644 --- a/custom_components/browser_mod/browser_mod_panel.js +++ b/custom_components/browser_mod/browser_mod_panel.js @@ -127,8 +127,76 @@ loadDevTools().then(() => { firstUpdated() { window.browser_mod.addEventListener("browser-mod-config-update", () => this.requestUpdate()); } + getFullySettings() { + if (!window.browser_mod.fully) + return null; + const retval = []; + const wcs = []; + // Web Content Settings + // Autoplay Videos + if (window.fully.getBooleanSetting("autoplayVideos") !== "true") + wcs.push($ `
  • Autoplay Videos
  • `); + // Autoplay Audio + if (window.fully.getBooleanSetting("autoplayAudio") !== "true") + wcs.push($ `
  • Autoplay Audio
  • `); + // Enable Webcam Access (PLUS) + if (window.fully.getBooleanSetting("webcamAccess") !== "true") + wcs.push($ `
  • Enable Webcam Access (PLUS)
  • `); + if (wcs.length !== 0) { + retval.push($ `
  • Web Content Settings
  • + `); + } + // Advanced Web Settings + // Enable JavaScript Interface (PLUS) + if (window.fully.getBooleanSetting("websiteIntegration") !== "true") + retval.push($ `
  • Advanced Web Settings
  • + `); + // Device Management + // Keep Screen On + if (window.fully.getBooleanSetting("keepScreenOn") !== "true") + retval.push($ `
  • Device Management
  • + `); + // Power Settings + // Prevent from Sleep while Screen Off + if (window.fully.getBooleanSetting("preventSleepWhileScreenOff") !== "true") + retval.push($ `
  • Power Settings
  • + `); + const md = []; + // Motion Detection (PLUS) + // Enable Visual Motion Detection + if (window.fully.getBooleanSetting("motionDetection") !== "true") + md.push($ `
  • Enable Visual Motion Detection
  • `); + // Turn Screen On on Motion + if (window.fully.getBooleanSetting("screenOnOnMotion") !== "true") + md.push($ `
  • Turn Screen On on Motion
  • `); + // Exit Screensaver on Motion + if (window.fully.getBooleanSetting("stopScreensaverOnMotion") !== "true") + md.push($ `
  • Exit Screensaver on Motion
  • `); + if (md.length !== 0) { + retval.push($ `
  • Motion Detection (PLUS)
  • + `); + } + // Remote Administration (PLUS) + // Enable Remote Administration + if (window.fully.getBooleanSetting("remoteAdmin") !== "true") + retval.push($ `
  • Remote Administration (PLUS)
  • + `); + return retval.length ? retval : null; + } render() { - var _a, _b, _c, _d, _e; + var _a, _b, _c, _d, _e, _f; return $ ` @@ -245,6 +313,15 @@ loadDevTools().then(() => { anywhere on the page. This should allow Browser Mod to work again. + ${((_f = window.browser_mod) === null || _f === void 0 ? void 0 : _f.fully) && this.getFullySettings() + ? $ ` + You are using FullyKiosk Browser. It is recommended + to enable the following settings: +
      + ${this.getFullySettings()} +
    +
    ` + : ""} ` : ""} diff --git a/js/config_panel/main.ts b/js/config_panel/main.ts index 9346775..7079421 100644 --- a/js/config_panel/main.ts +++ b/js/config_panel/main.ts @@ -58,6 +58,84 @@ loadDevTools().then(() => { ); } + getFullySettings() { + if (!window.browser_mod.fully) return null; + const retval = []; + const wcs = []; + // Web Content Settings + // Autoplay Videos + if (window.fully.getBooleanSetting("autoplayVideos") !== "true") + wcs.push(html`
  • Autoplay Videos
  • `); + // Autoplay Audio + if (window.fully.getBooleanSetting("autoplayAudio") !== "true") + wcs.push(html`
  • Autoplay Audio
  • `); + // Enable Webcam Access (PLUS) + if (window.fully.getBooleanSetting("webcamAccess") !== "true") + wcs.push(html`
  • Enable Webcam Access (PLUS)
  • `); + + if (wcs.length !== 0) { + retval.push(html`
  • Web Content Settings
  • + `); + } + + // Advanced Web Settings + // Enable JavaScript Interface (PLUS) + if (window.fully.getBooleanSetting("websiteIntegration") !== "true") + retval.push(html`
  • Advanced Web Settings
  • + `); + + // Device Management + // Keep Screen On + if (window.fully.getBooleanSetting("keepScreenOn") !== "true") + retval.push(html`
  • Device Management
  • + `); + + // Power Settings + // Prevent from Sleep while Screen Off + if ( + window.fully.getBooleanSetting("preventSleepWhileScreenOff") !== "true" + ) + retval.push(html`
  • Power Settings
  • + `); + + const md = []; + // Motion Detection (PLUS) + // Enable Visual Motion Detection + if (window.fully.getBooleanSetting("motionDetection") !== "true") + md.push(html`
  • Enable Visual Motion Detection
  • `); + // Turn Screen On on Motion + if (window.fully.getBooleanSetting("screenOnOnMotion") !== "true") + md.push(html`
  • Turn Screen On on Motion
  • `); + // Exit Screensaver on Motion + if (window.fully.getBooleanSetting("stopScreensaverOnMotion") !== "true") + md.push(html`
  • Exit Screensaver on Motion
  • `); + + if (md.length !== 0) { + retval.push(html`
  • Motion Detection (PLUS)
  • + `); + } + + // Remote Administration (PLUS) + // Enable Remote Administration + if (window.fully.getBooleanSetting("remoteAdmin") !== "true") + retval.push(html`
  • Remote Administration (PLUS)
  • + `); + + return retval.length ? retval : null; + } + render() { return html` @@ -177,6 +255,15 @@ loadDevTools().then(() => { anywhere on the page. This should allow Browser Mod to work again. + ${window.browser_mod?.fully && this.getFullySettings() + ? html` + You are using FullyKiosk Browser. It is recommended + to enable the following settings: +
      + ${this.getFullySettings()} +
    +
    ` + : ""} ` : ""} diff --git a/js/plugin/main.ts b/js/plugin/main.ts index 4ff28c1..a275672 100644 --- a/js/plugin/main.ts +++ b/js/plugin/main.ts @@ -25,7 +25,7 @@ import pjson from "../../package.json"; X Fullscreen - Motion/occupancy tracker x Information about interaction requirement - - Information about fullykiosk + x Information about fullykiosk - Commands x Rename browser_mod commands to browser_mod services x Framework diff --git a/js/plugin/types.ts b/js/plugin/types.ts index 0f694bb..2b7ca83 100644 --- a/js/plugin/types.ts +++ b/js/plugin/types.ts @@ -25,6 +25,8 @@ interface FullyKiosk { // Motion detection getCamshotJpgBase64: { (): String }; + + getBooleanSetting: { (key: String): String }; } declare global {