refactor: use getWebPreference() for all options (#26531)

This commit is contained in:
Milan Burda 2020-11-23 20:39:08 +01:00 committed by GitHub
parent 854d2b1574
commit 6932e02eb8
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
7 changed files with 20 additions and 51 deletions

View file

@ -1,3 +1,7 @@
const { getWebPreference } = process._linkedBinding('electron_renderer_web_frame');
const enableRemoteModule = getWebPreference(window, 'enableRemoteModule');
export const moduleList: ElectronInternal.ModuleEntry[] = [
{
name: 'contextBridge',
@ -34,7 +38,7 @@ if (BUILDFLAG(ENABLE_DESKTOP_CAPTURER)) {
});
}
if (BUILDFLAG(ENABLE_REMOTE_MODULE) && process.isRemoteModuleEnabled) {
if (BUILDFLAG(ENABLE_REMOTE_MODULE) && enableRemoteModule) {
moduleList.push({
name: 'remote',
loader: () => require('@electron/internal/renderer/api/remote')