diff --git a/spec-main/webview-spec.ts b/spec-main/webview-spec.ts index 66a4cd6eae27..1a8f133b7413 100644 --- a/spec-main/webview-spec.ts +++ b/spec-main/webview-spec.ts @@ -32,6 +32,20 @@ describe(' tag', function () { afterEach(closeAllWindows); + function hideChildWindows (e: any, wc: WebContents) { + wc.on('new-window', (event, url, frameName, disposition, options) => { + options.show = false; + }); + } + + before(() => { + app.on('web-contents-created', hideChildWindows); + }); + + after(() => { + app.off('web-contents-created', hideChildWindows); + }); + it('works without script tag in page', async () => { const w = new BrowserWindow({ show: false,