mirror of
https://github.com/electron/electron.git
synced 2026-04-10 03:01:51 -04:00
fix: don't warn about enableRemoteModule when it's undefined (#29023)
* fix: don't warn about enableRemoteModule when it's undefined * fix tests
This commit is contained in:
@@ -270,7 +270,7 @@ const warnAboutAllowedPopups = function () {
|
||||
|
||||
const warnAboutRemoteModuleWithRemoteContent = function (webPreferences?: Electron.WebPreferences) {
|
||||
if (!webPreferences || isLocalhost()) return;
|
||||
const remoteModuleEnabled = webPreferences.enableRemoteModule != null ? !!webPreferences.enableRemoteModule : true;
|
||||
const remoteModuleEnabled = webPreferences.enableRemoteModule != null ? !!webPreferences.enableRemoteModule : false;
|
||||
if (!remoteModuleEnabled) return;
|
||||
|
||||
if (getIsRemoteProtocol()) {
|
||||
|
||||
@@ -228,7 +228,7 @@ describe('security warnings', () => {
|
||||
it('should warn about enabled remote module with remote content', async () => {
|
||||
w = new BrowserWindow({
|
||||
show: false,
|
||||
webPreferences
|
||||
webPreferences: { ...webPreferences, enableRemoteModule: true }
|
||||
});
|
||||
|
||||
w.loadURL(`${serverUrl}/base-page-security.html`);
|
||||
@@ -239,7 +239,7 @@ describe('security warnings', () => {
|
||||
it('should not warn about enabled remote module with remote content from localhost', async () => {
|
||||
w = new BrowserWindow({
|
||||
show: false,
|
||||
webPreferences
|
||||
webPreferences: { ...webPreferences, enableRemoteModule: true }
|
||||
});
|
||||
w.loadURL(`${serverUrl}/base-page-security-onload-message.html`);
|
||||
const [,, message] = await emittedUntil(w.webContents, 'console-message', isLoaded);
|
||||
|
||||
Reference in New Issue
Block a user