|
@@ -241,8 +241,28 @@ describe('chromium feature', function () {
|
|
|
b = window.open(windowUrl, '', 'nodeIntegration=no,show=no')
|
|
|
})
|
|
|
|
|
|
- it('disables node integration when it is disabled on the parent window for chrome devtools URLs', function (done) {
|
|
|
- var b
|
|
|
+ it('disables webviewTag when node integration is disabled on the parent window', (done) => {
|
|
|
+ let b
|
|
|
+ listener = (event) => {
|
|
|
+ assert.equal(event.data.isWebViewUndefined, true)
|
|
|
+ b.close()
|
|
|
+ done()
|
|
|
+ }
|
|
|
+ window.addEventListener('message', listener)
|
|
|
+
|
|
|
+ const windowUrl = require('url').format({
|
|
|
+ pathname: `${fixtures}/pages/window-opener-no-web-view-tag.html`,
|
|
|
+ protocol: 'file',
|
|
|
+ query: {
|
|
|
+ p: `${fixtures}/pages/window-opener-web-view.html`
|
|
|
+ },
|
|
|
+ slashes: true
|
|
|
+ })
|
|
|
+ b = window.open(windowUrl, '', 'nodeIntegration=no,show=no')
|
|
|
+ })
|
|
|
+
|
|
|
+ it('disables node integration when it is disabled on the parent window for chrome devtools URLs', (done) => {
|
|
|
+ let b
|
|
|
app.once('web-contents-created', (event, contents) => {
|
|
|
contents.once('did-finish-load', () => {
|
|
|
contents.executeJavaScript('typeof process').then((typeofProcessGlobal) => {
|
|
@@ -260,7 +280,7 @@ describe('chromium feature', function () {
|
|
|
app.once('web-contents-created', (event, contents) => {
|
|
|
contents.once('did-finish-load', () => {
|
|
|
app.once('browser-window-created', (event, window) => {
|
|
|
- const preferences = window.webContents.getWebPreferences()
|
|
|
+ const preferences = window.webContents.getLastWebPreferences()
|
|
|
assert.equal(preferences.javascript, false)
|
|
|
window.destroy()
|
|
|
b.close()
|
|
@@ -486,7 +506,7 @@ describe('chromium feature', function () {
|
|
|
done()
|
|
|
}
|
|
|
window.addEventListener('message', listener)
|
|
|
- w = window.open(url, '', 'show=no')
|
|
|
+ w = window.open(url, '', 'show=no,nodeIntegration=no')
|
|
|
})
|
|
|
|
|
|
it('works when origin matches', function (done) {
|
|
@@ -495,7 +515,7 @@ describe('chromium feature', function () {
|
|
|
done()
|
|
|
}
|
|
|
window.addEventListener('message', listener)
|
|
|
- w = window.open(`file://${fixtures}/pages/window-opener-location.html`, '', 'show=no')
|
|
|
+ w = window.open(`file://${fixtures}/pages/window-opener-location.html`, '', 'show=no,nodeIntegration=no')
|
|
|
})
|
|
|
|
|
|
it('works when origin does not match opener but has node integration', function (done) {
|