2020-11-23 19:39:08 +00:00
|
|
|
const { getWebPreference } = process._linkedBinding('electron_renderer_web_frame');
|
2018-10-13 17:50:07 +00:00
|
|
|
|
2020-11-23 19:39:08 +00:00
|
|
|
const enableRemoteModule = getWebPreference(window, 'enableRemoteModule');
|
2018-06-13 16:15:34 +00:00
|
|
|
|
2017-03-06 14:58:10 +00:00
|
|
|
// Renderer side modules, please sort alphabetically.
|
2019-08-23 09:18:58 +00:00
|
|
|
export const rendererModuleList: ElectronInternal.ModuleEntry[] = [
|
2019-10-18 19:57:09 +00:00
|
|
|
{ name: 'contextBridge', loader: () => require('./context-bridge') },
|
2019-06-02 20:03:03 +00:00
|
|
|
{ name: 'crashReporter', loader: () => require('./crash-reporter') },
|
|
|
|
{ name: 'ipcRenderer', loader: () => require('./ipc-renderer') },
|
2020-08-24 16:36:13 +00:00
|
|
|
{ name: 'nativeImage', loader: () => require('./native-image') },
|
2019-06-02 20:03:03 +00:00
|
|
|
{ name: 'webFrame', loader: () => require('./web-frame') }
|
2020-03-20 20:28:31 +00:00
|
|
|
];
|
2019-06-02 20:03:03 +00:00
|
|
|
|
2020-05-10 23:06:07 +00:00
|
|
|
if (BUILDFLAG(ENABLE_DESKTOP_CAPTURER)) {
|
|
|
|
rendererModuleList.push({
|
|
|
|
name: 'desktopCapturer',
|
|
|
|
loader: () => require('@electron/internal/renderer/api/desktop-capturer')
|
|
|
|
});
|
2019-06-02 20:03:03 +00:00
|
|
|
}
|
|
|
|
|
2020-05-10 23:06:07 +00:00
|
|
|
if (BUILDFLAG(ENABLE_REMOTE_MODULE) && enableRemoteModule) {
|
|
|
|
rendererModuleList.push({
|
|
|
|
name: 'remote',
|
|
|
|
loader: () => require('@electron/internal/renderer/api/remote')
|
|
|
|
});
|
2019-06-02 20:03:03 +00:00
|
|
|
}
|