blob: c56683585a9274fa38fed14708546d33816c09b9 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
|
/* global process */
const { ipcRenderer } = require('electron');
const jitsiMeetElectronUtils = require('@jitsi/electron-sdk');
const { openExternalLink } = require('../features/utils/openExternalLink');
const whitelistedIpcChannels = [ 'protocol-data-msg', 'renderer-ready' ];
window.jitsiNodeAPI = {
openExternalLink,
platform: process.platform,
jitsiMeetElectronUtils,
ipc: {
on: (channel, listener) => {
if (!whitelistedIpcChannels.includes(channel)) {
return;
}
return ipcRenderer.on(channel, listener);
},
send: channel => {
if (!whitelistedIpcChannels.includes(channel)) {
return;
}
return ipcRenderer.send(channel);
},
removeListener: (channel, listener) => {
if (!whitelistedIpcChannels.includes(channel)) {
return;
}
return ipcRenderer.removeListener(channel, listener);
}
}
};
|