electron/lib/renderer/api/module-list.ts

20 lines
810 B
TypeScript
Raw Normal View History

const features = process.electronBinding('features')
const v8Util = process.electronBinding('v8_util')
const enableRemoteModule = v8Util.getHiddenValue<boolean>(global, 'enableRemoteModule')
// Renderer side modules, please sort alphabetically.
export const rendererModuleList: ElectronInternal.ModuleEntry[] = [
2019-06-02 20:03:03 +00:00
{ name: 'crashReporter', loader: () => require('./crash-reporter') },
{ name: 'ipcRenderer', loader: () => require('./ipc-renderer') },
{ name: 'webFrame', loader: () => require('./web-frame') }
]
2019-06-02 20:03:03 +00:00
if (features.isDesktopCapturerEnabled()) {
rendererModuleList.push({ name: 'desktopCapturer', loader: () => require('./desktop-capturer') })
2019-06-02 20:03:03 +00:00
}
if (features.isRemoteModuleEnabled() && enableRemoteModule) {
rendererModuleList.push({ name: 'remote', loader: () => require('./remote') })
2019-06-02 20:03:03 +00:00
}