feat: expose dummy module.exports to the sandboxed preload scripts (#39484)

This commit is contained in:
Milan Burda 2023-08-22 06:43:08 +02:00 committed by GitHub
parent 90865fa97d
commit 3102a257af
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 5 additions and 3 deletions

View file

@ -1186,7 +1186,7 @@ describe('chromium features', () => {
w.webContents.executeJavaScript('window.child = window.open(); child.opener = null');
const [, { webContents }] = await once(app, 'browser-window-created');
const [,, message] = await once(webContents, 'console-message');
expect(message).to.equal('{"require":"function","module":"undefined","process":"object","Buffer":"function"}');
expect(message).to.equal('{"require":"function","module":"object","exports":"object","process":"object","Buffer":"function"}');
});
it('disables the <webview> tag when it is disabled on the parent window', async () => {