diff options
author | RaindropsSys <contact@minteck.org> | 2023-04-27 13:32:35 +0200 |
---|---|---|
committer | RaindropsSys <contact@minteck.org> | 2023-04-27 13:32:35 +0200 |
commit | ade37c5b0ad6dc2c61be1efb5421862321ace805 (patch) | |
tree | ef0310a032fe9b9757dce3f9b15c7867b12cae2c /index.js | |
parent | 3661eadc63e4d2a240f88c18c4d50d12956d7223 (diff) | |
download | delta-kiosk-ade37c5b0ad6dc2c61be1efb5421862321ace805.tar.gz delta-kiosk-ade37c5b0ad6dc2c61be1efb5421862321ace805.tar.bz2 delta-kiosk-ade37c5b0ad6dc2c61be1efb5421862321ace805.zip |
Updated 4 files (automated)
Diffstat (limited to 'index.js')
-rw-r--r-- | index.js | 19 |
1 files changed, 18 insertions, 1 deletions
@@ -1,4 +1,5 @@ -const { app, BrowserWindow, Menu, ipcMain, MenuItem } = require('electron'); +const { app, BrowserWindow, Menu, ipcMain, MenuItem, globalShortcut, shell} = require('electron'); +const os = require("os"); require('@electron/remote/main').initialize(); const createWindow = () => { @@ -6,6 +7,8 @@ const createWindow = () => { width: 800, height: 600, fullscreen: true, + kiosk: os.platform() === "win32", + autoHideMenuBar: true, title: "Delta Kiosk", webPreferences: { nodeIntegration: true, @@ -113,12 +116,26 @@ const createWindow = () => { }) ]); + mainWindow.webContents.setWindowOpenHandler((details) => { + return { + action: 'deny' + }; + }); + + mainWindow.webContents.session.on('will-download', (event, item, webContents) => { + item.cancel() + }) + mainWindow.setMenu(menu); Menu.setApplicationMenu(menu); mainWindow.loadFile('index.html'); } app.whenReady().then(() => { + globalShortcut.register('Ctrl+Esc', () => { + console.log('Disabled Windows key') + }) + createWindow() }) |