Add spec for chrome-devtools URL with no node integration
authorKevin Sawicki <kevinsawicki@gmail.com>
Mon, 24 Apr 2017 17:25:12 +0000 (10:25 -0700)
committerKevin Sawicki <kevinsawicki@gmail.com>
Tue, 25 Apr 2017 20:36:08 +0000 (13:36 -0700)
spec/chromium-spec.js

index 977f25e..9cce9fe 100644 (file)
@@ -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) => {