diff --git a/build/builtin/main.js b/build/builtin/main.js index 3a11d363f96..34df1fab6df 100644 --- a/build/builtin/main.js +++ b/build/builtin/main.js @@ -29,7 +29,6 @@ app.once('ready', () => { webPreferences: { nodeIntegration: true, contextIsolation: false, - webviewTag: true, enableWebSQL: false, nativeWindowOpen: true } diff --git a/src/vs/base/browser/ui/sash/sash.ts b/src/vs/base/browser/ui/sash/sash.ts index d1db81e7aae..217d3f912b5 100644 --- a/src/vs/base/browser/ui/sash/sash.ts +++ b/src/vs/base/browser/ui/sash/sash.ts @@ -362,13 +362,7 @@ export class Sash extends Disposable { return; } - // Select both iframes and webviews; internally Electron nests an iframe - // in its component, but this isn't queryable. - const iframes = [ - ...getElementsByTagName('iframe'), - ...getElementsByTagName('webview'), - ]; - + const iframes = getElementsByTagName('iframe'); for (const iframe of iframes) { iframe.style.pointerEvents = 'none'; // disable mouse events on iframes as long as we drag the sash } diff --git a/src/vs/code/electron-main/app.ts b/src/vs/code/electron-main/app.ts index 9606a8f1d1d..12b89c84688 100644 --- a/src/vs/code/electron-main/app.ts +++ b/src/vs/code/electron-main/app.ts @@ -51,7 +51,7 @@ import { ElectronURLListener } from 'vs/platform/url/electron-main/electronUrlLi import { serve as serveDriver } from 'vs/platform/driver/electron-main/driver'; import { IMenubarMainService, MenubarMainService } from 'vs/platform/menubar/electron-main/menubarMainService'; import { registerContextMenuListener } from 'vs/base/parts/contextmenu/electron-main/contextmenu'; -import { sep, posix, join, isAbsolute } from 'vs/base/common/path'; +import { posix, join, isAbsolute } from 'vs/base/common/path'; import { joinPath } from 'vs/base/common/resources'; import { localize } from 'vs/nls'; import { Schemas } from 'vs/base/common/network'; @@ -200,41 +200,6 @@ export class CodeApplication extends Disposable { // !!! DO NOT CHANGE without consulting the documentation !!! // app.on('web-contents-created', (event, contents) => { - contents.on('will-attach-webview', (event, webPreferences, params) => { - - const isValidWebviewSource = (source: string | undefined): boolean => { - if (!source) { - return false; - } - - const uri = URI.parse(source); - if (uri.scheme === Schemas.vscodeWebview) { - return uri.path === '/index.html' || uri.path === '/electron-browser-index.html'; - } - - const srcUri = uri.fsPath.toLowerCase(); - const rootUri = URI.file(this.environmentMainService.appRoot).fsPath.toLowerCase(); - - return srcUri.startsWith(rootUri + sep); - }; - - // Ensure defaults - delete webPreferences.preload; - webPreferences.nodeIntegration = false; - - // Verify URLs being loaded - // https://github.com/electron/electron/issues/21553 - if (isValidWebviewSource(params.src) && isValidWebviewSource((webPreferences as { preloadURL: string }).preloadURL)) { - return; - } - - delete (webPreferences as { preloadURL: string | undefined }).preloadURL; // https://github.com/electron/electron/issues/21553 - - // Otherwise prevent loading - this.logService.error('webContents#web-contents-created: Prevented webview attach'); - - event.preventDefault(); - }); contents.on('will-navigate', event => { this.logService.error('webContents#will-navigate: Prevented webcontent navigation'); diff --git a/src/vs/platform/windows/electron-main/window.ts b/src/vs/platform/windows/electron-main/window.ts index 1062fda4e76..fd54a2aa061 100644 --- a/src/vs/platform/windows/electron-main/window.ts +++ b/src/vs/platform/windows/electron-main/window.ts @@ -193,7 +193,6 @@ export class CodeWindow extends Disposable implements ICodeWindow { enableWebSQL: false, spellcheck: false, nativeWindowOpen: true, - webviewTag: true, zoomFactor: zoomLevelToZoomFactor(windowSettings?.zoomLevel), ...this.environmentMainService.sandbox ? diff --git a/test/unit/electron/index.js b/test/unit/electron/index.js index 99bb64e92a4..d13ea9c6d87 100644 --- a/test/unit/electron/index.js +++ b/test/unit/electron/index.js @@ -169,8 +169,7 @@ app.on('ready', () => { contextIsolation: false, enableWebSQL: false, spellcheck: false, - nativeWindowOpen: true, - webviewTag: true + nativeWindowOpen: true } });