Files
feishin/src/preload/ipc.ts
T
Kendall Garner 7befd70e21 Apply additional security recommendations (#2050)
* enable sandbox

* enable CSP (umami tentatively works?) and reduce amount of ipc APIs exposed

* remove csp from index
2026-05-22 22:09:22 -07:00

22 lines
494 B
TypeScript

import { ipcRenderer } from 'electron';
const removeAllListeners = (channel: string) => {
ipcRenderer.removeAllListeners(channel);
};
const send = (channel: string, ...args: any[]) => {
ipcRenderer.send(channel, ...args);
};
const removeListener = (channel: string, listener: (event: any, ...args: any[]) => void) => {
ipcRenderer.removeListener(channel, listener);
};
export const ipc = {
removeAllListeners,
removeListener,
send,
};
export type Ipc = typeof ipc;