X Tutup
Skip to content

Commit 5bdf97e

Browse files
authored
test: hide child windows in webview spec (electron#23682)
1 parent 3137d5f commit 5bdf97e

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

spec-main/webview-spec.ts

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,20 @@ describe('<webview> tag', function () {
3232

3333
afterEach(closeAllWindows);
3434

35+
function hideChildWindows (e: any, wc: WebContents) {
36+
wc.on('new-window', (event, url, frameName, disposition, options) => {
37+
options.show = false;
38+
});
39+
}
40+
41+
before(() => {
42+
app.on('web-contents-created', hideChildWindows);
43+
});
44+
45+
after(() => {
46+
app.off('web-contents-created', hideChildWindows);
47+
});
48+
3549
it('works without script tag in page', async () => {
3650
const w = new BrowserWindow({
3751
show: false,

0 commit comments

Comments
 (0)
X Tutup