simpliplay-desktop/simpliplay/preload.js
Anirudh Sevugan 416e9e7bac Added new add-on system
Addons can do anything, from changing the look and feel of the app, adding new features, and even add references to your favorite characters!
2025-07-30 19:14:47 -05:00

12 lines
421 B
JavaScript

const { contextBridge, ipcRenderer } = require("electron");
contextBridge.exposeInMainWorld("electron", {
receive: (channel, callback) => {
const validChannels = ["play-media", "load-addon", "unload-addon"];
if (validChannels.includes(channel)) {
ipcRenderer.removeAllListeners(channel); // Prevent multiple callbacks
ipcRenderer.on(channel, (_event, ...args) => callback(...args));
}
},
});