sandbox - expose limited IPC via preload script

This commit is contained in:
Benjamin Pasero
2020-05-22 12:23:43 +02:00
parent 3514e96bf5
commit a4a5b1f19c
3 changed files with 100 additions and 0 deletions

View File

@@ -163,6 +163,7 @@ export class CodeWindow extends Disposable implements ICodeWindow {
show: !isFullscreenOrMaximized,
title: product.nameLong,
webPreferences: {
preload: URI.parse(this.doGetPreloadUrl()).fsPath,
nodeIntegration: true,
nodeIntegrationInWorker: RUN_TEXTMATE_IN_WORKER,
webviewTag: true,
@@ -777,6 +778,10 @@ export class CodeWindow extends Disposable implements ICodeWindow {
return `${require.toUrl('vs/code/electron-browser/workbench/workbench.html')}?config=${encodeURIComponent(JSON.stringify(config))}`;
}
private doGetPreloadUrl(): string {
return `${require.toUrl('vs/code/electron-browser/workbench/preload.js')}`;
}
serializeWindowState(): IWindowState {
if (!this._win) {
return defaultWindowState();