mirror of
https://github.com/letian1650/N3RD.git
synced 2025-01-25 04:05:17 +08:00
9 lines
266 B
JavaScript
9 lines
266 B
JavaScript
const { contextBridge, ipcRenderer } = require('electron');
|
|
|
|
contextBridge.exposeInMainWorld('msg_center', {
|
|
send: (...args) => ipcRenderer.send('msg', ...args),
|
|
on: (fn) => {
|
|
ipcRenderer.on('msg', (event, ...args) => fn(event, ...args));
|
|
},
|
|
});
|