From 4f509150ab86e7919dd05cdf19392d5d0ed95158 Mon Sep 17 00:00:00 2001 From: RaindropsSys Date: Wed, 19 Apr 2023 21:25:05 +0200 Subject: Updated 2 files and added kiosk.js (automated) --- index.html | 11 ++++++++++- index.js | 9 +++++++-- kiosk.js | 12 ++++++++++++ 3 files changed, 29 insertions(+), 3 deletions(-) create mode 100644 kiosk.js diff --git a/index.html b/index.html index aae591d..02fe2bd 100644 --- a/index.html +++ b/index.html @@ -86,6 +86,7 @@ - + \ No newline at end of file diff --git a/index.js b/index.js index 4bbe019..803f9a1 100644 --- a/index.js +++ b/index.js @@ -1,4 +1,4 @@ -const { app, BrowserWindow } = require('electron'); +const { app, BrowserWindow, Menu, ipcMain } = require('electron'); require('@electron/remote/main').initialize(); const createWindow = () => { @@ -17,8 +17,13 @@ const createWindow = () => { require('@electron/remote/main').enable(mainWindow.webContents); + ipcMain.on('devtools', () => { + mainWindow.send('devtools'); + }); + + mainWindow.setMenu(Menu.buildFromTemplate([])); + Menu.setApplicationMenu(Menu.buildFromTemplate([])); mainWindow.loadFile('index.html'); - mainWindow.setMenu(null); } app.whenReady().then(() => { diff --git a/kiosk.js b/kiosk.js new file mode 100644 index 0000000..640dcb3 --- /dev/null +++ b/kiosk.js @@ -0,0 +1,12 @@ +const { contextBridge } = require('electron') + +contextBridge.exposeInMainWorld('kiosk', { + devtools: () => { + require('electron').ipcRenderer.send("devtools"); + }, + reload: () => { + location.reload(); + } +}); + +console.log("Preloaded kiosk additions"); \ No newline at end of file -- cgit