1
0
mirror of https://github.com/upscayl/upscayl.git synced 2025-02-17 19:19:23 +01:00
upscayl/main/preload.js
2022-08-17 08:07:50 +05:30

11 lines
359 B
JavaScript

const { ipcRenderer, contextBridge } = require("electron");
// 'ipcRenderer' will be available in index.js with the method 'window.electron'
contextBridge.exposeInMainWorld("electron", {
send: (command, payload) => ipcRenderer.send(command, payload),
on: (command, func) =>
ipcRenderer.on(command, (event, args) => {
func(...args);
}),
});