chore: make "nodeIntegration" and "webviewTag" default to false (#16235)
This commit is contained in:
parent
cdf4bfa68f
commit
fade3eb679
23 changed files with 261 additions and 140 deletions
|
@ -59,7 +59,12 @@ describe('security warnings', () => {
|
|||
})
|
||||
|
||||
it('should warn about Node.js integration with remote content', (done) => {
|
||||
w = new BrowserWindow({ show: false })
|
||||
w = new BrowserWindow({
|
||||
show: false,
|
||||
webPreferences: {
|
||||
nodeIntegration: true
|
||||
}
|
||||
})
|
||||
w.webContents.once('console-message', (e, level, message) => {
|
||||
assert(message.includes('Node.js Integration with Remote Content'), message)
|
||||
done()
|
||||
|
@ -75,7 +80,6 @@ describe('security warnings', () => {
|
|||
show: false,
|
||||
webPreferences: {
|
||||
webSecurity: false,
|
||||
nodeIntegration: false,
|
||||
...webPreferences
|
||||
}
|
||||
})
|
||||
|
@ -90,10 +94,7 @@ describe('security warnings', () => {
|
|||
it('should warn about insecure Content-Security-Policy', (done) => {
|
||||
w = new BrowserWindow({
|
||||
show: false,
|
||||
webPreferences: {
|
||||
nodeIntegration: false,
|
||||
...webPreferences
|
||||
}
|
||||
webPreferences
|
||||
})
|
||||
|
||||
w.webContents.once('console-message', (e, level, message) => {
|
||||
|
@ -110,7 +111,6 @@ describe('security warnings', () => {
|
|||
show: false,
|
||||
webPreferences: {
|
||||
allowRunningInsecureContent: true,
|
||||
nodeIntegration: false,
|
||||
...webPreferences
|
||||
}
|
||||
})
|
||||
|
@ -127,7 +127,6 @@ describe('security warnings', () => {
|
|||
show: false,
|
||||
webPreferences: {
|
||||
experimentalFeatures: true,
|
||||
nodeIntegration: false,
|
||||
...webPreferences
|
||||
}
|
||||
})
|
||||
|
@ -144,7 +143,6 @@ describe('security warnings', () => {
|
|||
show: false,
|
||||
webPreferences: {
|
||||
enableBlinkFeatures: ['my-cool-feature'],
|
||||
nodeIntegration: false,
|
||||
...webPreferences
|
||||
}
|
||||
})
|
||||
|
@ -159,10 +157,7 @@ describe('security warnings', () => {
|
|||
it('should warn about allowpopups', (done) => {
|
||||
w = new BrowserWindow({
|
||||
show: false,
|
||||
webPreferences: {
|
||||
nodeIntegration: false,
|
||||
...webPreferences
|
||||
}
|
||||
webPreferences
|
||||
})
|
||||
w.webContents.once('console-message', (e, level, message) => {
|
||||
assert(message.includes('allowpopups'), message)
|
||||
|
@ -175,10 +170,7 @@ describe('security warnings', () => {
|
|||
it('should warn about insecure resources', (done) => {
|
||||
w = new BrowserWindow({
|
||||
show: false,
|
||||
webPreferences: {
|
||||
nodeIntegration: false,
|
||||
...webPreferences
|
||||
}
|
||||
webPreferences
|
||||
})
|
||||
w.webContents.once('console-message', (e, level, message) => {
|
||||
assert(message.includes('Insecure Resources'), message)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue