Prepare migration for sandboxing (path.join in preload)

This commit is contained in:
TC
2022-09-05 00:31:29 +02:00
parent 91e4433aba
commit 1f5f597561
4 changed files with 33 additions and 13 deletions

View File

@ -1,3 +1,5 @@
const path = require("path");
const is = require("electron-is");
const { app, BrowserWindow, ipcMain, ipcRenderer } = require("electron");
@ -11,6 +13,7 @@ module.exports.setupAppControls = () => {
ipcMain.on('restart', restart);
ipcMain.handle('getDownloadsFolder', () => app.getPath("downloads"));
ipcMain.on('reload', () => BrowserWindow.getFocusedWindow().webContents.loadURL(config.get("url")));
ipcMain.handle('getPath', (_, ...args) => path.join(...args));
}
function restart() {