Merge pull request #9278 from electron/dont-override-argument-value
Disable node integration in chrome-devtools URLs
This commit is contained in:
commit
4e7e9d1752
2 changed files with 15 additions and 1 deletions
|
@ -78,7 +78,7 @@ for (let arg of process.argv) {
|
|||
if (window.location.protocol === 'chrome-devtools:') {
|
||||
// Override some inspector APIs.
|
||||
require('./inspector')
|
||||
nodeIntegration = 'true'
|
||||
nodeIntegration = 'false'
|
||||
} else if (window.location.protocol === 'chrome-extension:') {
|
||||
// Add implementations of chrome API.
|
||||
require('./chrome-api').injectTo(window.location.hostname, isBackgroundPage, window)
|
||||
|
|
|
@ -229,6 +229,20 @@ 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
|
||||
app.once('web-contents-created', (event, contents) => {
|
||||
contents.once('did-finish-load', () => {
|
||||
contents.executeJavaScript('typeof process').then((typeofProcessGlobal) => {
|
||||
assert.equal(typeofProcessGlobal, 'undefined')
|
||||
b.close()
|
||||
done()
|
||||
}).catch(done)
|
||||
})
|
||||
})
|
||||
b = window.open('chrome-devtools://devtools/bundled/inspector.html', '', 'nodeIntegration=no,show=no')
|
||||
})
|
||||
|
||||
it('disables JavaScript when it is disabled on the parent window', function (done) {
|
||||
var b
|
||||
app.once('web-contents-created', (event, contents) => {
|
||||
|
|
Loading…
Reference in a new issue