mirror of
https://github.com/upscayl/upscayl.git
synced 2024-11-12 01:40:53 +01:00
17 lines
515 B
JavaScript
17 lines
515 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(event, args);
|
|
}),
|
|
startListen: (func) => {
|
|
ipcRenderer.addListener("stdout",func)
|
|
},
|
|
stopListen: (func) => {
|
|
ipcRenderer.removeListener("stdout",func)
|
|
},
|
|
});
|