Skip to content

Commit

Permalink
REVIEW: Enable node integration for browser window
Browse files Browse the repository at this point in the history
The default values have been flipped for security in
electron/electron#16235
  • Loading branch information
Deepak Mohan authored and deepak1556 committed Jun 4, 2019
1 parent fb7c55e commit cd7e115
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 3 deletions.
1 change: 1 addition & 0 deletions src/vs/code/electron-main/sharedProcess.ts
Expand Up @@ -38,6 +38,7 @@ export class SharedProcess implements ISharedProcess {
images: false,
webaudio: false,
webgl: false,
nodeIntegration: true,
disableBlinkFeatures: 'Auxclick' // do NOT change, allows us to identify this window as shared-process in the process explorer
}
});
Expand Down
3 changes: 2 additions & 1 deletion src/vs/code/electron-main/window.ts
Expand Up @@ -133,7 +133,8 @@ 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
}
};

Expand Down
Expand Up @@ -393,7 +393,8 @@ export class WebviewElement extends Disposable implements Webview {

this._webview = document.createElement('webview');
this._webview.setAttribute('partition', `webview${Date.now()}`);
this._webview.setAttribute('webpreferences', 'contextIsolation=yes');

this._webview.setAttribute('webpreferences', 'contextIsolation=yes,nodeIntegration=yes');

this._webview.style.flex = '0 1';
this._webview.style.width = '0';
Expand Down
3 changes: 2 additions & 1 deletion test/electron/index.js
Expand Up @@ -106,7 +106,8 @@ app.on('ready', () => {
show: false,
webPreferences: {
backgroundThrottling: false,
webSecurity: false
webSecurity: false,
nodeIntegration: true
}
});

Expand Down

0 comments on commit cd7e115

Please sign in to comment.