diff --git a/build/builtin/main.js b/build/builtin/main.js index 849027ad2b9f0..b094a67cac5c7 100644 --- a/build/builtin/main.js +++ b/build/builtin/main.js @@ -10,7 +10,7 @@ const path = require('path'); let window = null; app.once('ready', () => { - window = new BrowserWindow({ width: 800, height: 600 }); + window = new BrowserWindow({ width: 800, height: 600, webPreferences: { nodeIntegration: true, webviewTag: true } }); window.setMenuBarVisibility(false); window.loadURL(url.format({ pathname: path.join(__dirname, 'index.html'), protocol: 'file:', slashes: true })); // window.webContents.openDevTools(); diff --git a/src/vs/code/electron-main/auth.ts b/src/vs/code/electron-main/auth.ts index ed92533c32fb6..6fbd3fcce46a0 100644 --- a/src/vs/code/electron-main/auth.ts +++ b/src/vs/code/electron-main/auth.ts @@ -54,7 +54,11 @@ export class ProxyAuthHandler { width: 450, height: 220, show: true, - title: 'VS Code' + title: 'VS Code', + webPreferences: { + nodeIntegration: true, + webviewTag: true + } }; const focusedWindow = this.windowsMainService.getFocusedWindow(); diff --git a/src/vs/code/electron-main/sharedProcess.ts b/src/vs/code/electron-main/sharedProcess.ts index 8076c873cc682..6d3efb56dfb78 100644 --- a/src/vs/code/electron-main/sharedProcess.ts +++ b/src/vs/code/electron-main/sharedProcess.ts @@ -36,7 +36,7 @@ export class SharedProcess implements ISharedProcess { backgroundColor: this.themeMainService.getBackgroundColor(), webPreferences: { images: false, - webaudio: false, + nodeIntegration: true, webgl: false, disableBlinkFeatures: 'Auxclick' // do NOT change, allows us to identify this window as shared-process in the process explorer } diff --git a/src/vs/code/electron-main/window.ts b/src/vs/code/electron-main/window.ts index ec398df67eddc..32f6aaef25417 100644 --- a/src/vs/code/electron-main/window.ts +++ b/src/vs/code/electron-main/window.ts @@ -134,7 +134,9 @@ export class CodeWindow extends Disposable implements ICodeWindow { // want to enforce that Code stays in the foreground. This triggers a disable_hidden_ // flag that Electron provides via patch: // https://github.com/electron/libchromiumcontent/blob/master/patches/common/chromium/disable_hidden.patch - backgroundThrottling: false + backgroundThrottling: false, + nodeIntegration: true, + webviewTag: true } }; diff --git a/src/vs/workbench/contrib/webview/electron-browser/webviewElement.ts b/src/vs/workbench/contrib/webview/electron-browser/webviewElement.ts index b86e3120d0034..1d4e6fea04fa2 100644 --- a/src/vs/workbench/contrib/webview/electron-browser/webviewElement.ts +++ b/src/vs/workbench/contrib/webview/electron-browser/webviewElement.ts @@ -385,6 +385,7 @@ export class WebviewElement extends Disposable implements Webview { this._webview = document.createElement('webview'); this._webview.setAttribute('partition', `webview${Date.now()}`); + this._webview.setAttribute('nodeintegration', 'yes'); this._webview.setAttribute('webpreferences', 'contextIsolation=yes'); this._webview.style.flex = '0 1'; diff --git a/test/electron/index.js b/test/electron/index.js index ebd97e3b98bf0..2224fd321e1db 100644 --- a/test/electron/index.js +++ b/test/electron/index.js @@ -106,7 +106,9 @@ app.on('ready', () => { show: false, webPreferences: { backgroundThrottling: false, - webSecurity: false + nodeIntegration: true, + webSecurity: false, + webviewTag: true } });