build: allow use of BUILDFLAG directives from within JS code (#20328)
This commit is contained in:
parent
f9c04449f4
commit
392ea320cf
16 changed files with 132 additions and 74 deletions
|
@ -1,5 +1,3 @@
|
|||
const features = process.electronBinding('features');
|
||||
|
||||
export const moduleList: ElectronInternal.ModuleEntry[] = [
|
||||
{
|
||||
name: 'contextBridge',
|
||||
|
@ -29,14 +27,14 @@ export const moduleList: ElectronInternal.ModuleEntry[] = [
|
|||
}
|
||||
];
|
||||
|
||||
if (features.isDesktopCapturerEnabled()) {
|
||||
if (BUILDFLAG(ENABLE_DESKTOP_CAPTURER)) {
|
||||
moduleList.push({
|
||||
name: 'desktopCapturer',
|
||||
loader: () => require('@electron/internal/renderer/api/desktop-capturer')
|
||||
});
|
||||
}
|
||||
|
||||
if (features.isRemoteModuleEnabled() && process.isRemoteModuleEnabled) {
|
||||
if (BUILDFLAG(ENABLE_REMOTE_MODULE) && process.isRemoteModuleEnabled) {
|
||||
moduleList.push({
|
||||
name: 'remote',
|
||||
loader: () => require('@electron/internal/renderer/api/remote')
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue