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
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 () => {

View File

@@ -1,6 +1,7 @@
const types = {
require: typeof require,
module: typeof module,
exports: typeof exports,
process: typeof process,
Buffer: typeof Buffer
};