feat: sandbox preloads by default (#32869)

This commit is contained in:
Jeremy Rose 2022-07-11 16:28:09 -07:00 committed by GitHub
parent f63bba8ce2
commit 4190ec2482
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 7 additions and 4 deletions

View file

@ -243,6 +243,7 @@ describe('<webview> tag', function () {
it('preload script can require modules that still use "process" and "Buffer" when nodeintegration is off', async () => {
const message = await startLoadingWebViewAndWaitForMessage(webview, {
preload: `${fixtures}/module/preload-node-off-wrapper.js`,
webpreferences: 'sandbox=no',
src: `file://${fixtures}/api/blank.html`
});
@ -288,6 +289,7 @@ describe('<webview> tag', function () {
it('works without script tag in page', async () => {
const message = await startLoadingWebViewAndWaitForMessage(webview, {
preload: `${fixtures}/module/preload.js`,
webpreferences: 'sandbox=no',
src: `file://${fixtures}pages/base-page.html`
});
@ -303,6 +305,7 @@ describe('<webview> tag', function () {
it('resolves relative URLs', async () => {
const message = await startLoadingWebViewAndWaitForMessage(webview, {
preload: '../fixtures/module/preload.js',
webpreferences: 'sandbox=no',
src: `file://${fixtures}/pages/e.html`
});
@ -390,6 +393,7 @@ describe('<webview> tag', function () {
const message = await startLoadingWebViewAndWaitForMessage(webview, {
disablewebsecurity: '',
preload: `${fixtures}/module/preload.js`,
webpreferences: 'sandbox=no',
src: `file://${fixtures}/pages/e.html`
});