mirror of
https://github.com/A-Star100/simpliplay-desktop.git
synced 2025-09-17 22:29:38 +00:00

Addons can do anything, from changing the look and feel of the app, adding new features, and even add references to your favorite characters!
12 lines
421 B
JavaScript
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));
|
|
}
|
|
},
|
|
});
|