Add failing spec for inheriting Javascript web preference
This commit is contained in:
parent
6ec74060b4
commit
cee0507090
2 changed files with 37 additions and 0 deletions
|
@ -229,6 +229,31 @@ describe('chromium feature', function () {
|
|||
b = window.open(windowUrl, '', '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) => {
|
||||
contents.once('did-finish-load', () => {
|
||||
app.once('browser-window-created', (event, window) => {
|
||||
const preferences = window.webContents.getWebPreferences()
|
||||
assert.equal(preferences.javascript, false)
|
||||
window.destroy()
|
||||
b.close()
|
||||
done()
|
||||
})
|
||||
// Click link on page
|
||||
contents.sendInputEvent({type: 'mouseDown', clickCount: 1, x: 1, y: 1})
|
||||
contents.sendInputEvent({type: 'mouseUp', clickCount: 1, x: 1, y: 1})
|
||||
})
|
||||
})
|
||||
|
||||
var windowUrl = require('url').format({
|
||||
pathname: `${fixtures}/pages/window-no-javascript.html`,
|
||||
protocol: 'file',
|
||||
slashes: true
|
||||
})
|
||||
b = window.open(windowUrl, '', 'javascript=no,show=no')
|
||||
})
|
||||
|
||||
it('does not override child options', function (done) {
|
||||
var b, size
|
||||
size = {
|
||||
|
|
12
spec/fixtures/pages/window-no-javascript.html
vendored
Normal file
12
spec/fixtures/pages/window-no-javascript.html
vendored
Normal file
|
@ -0,0 +1,12 @@
|
|||
<!DOCTYPE html>
|
||||
<html>
|
||||
<style>
|
||||
* {
|
||||
padding: 0;
|
||||
margin: 0;
|
||||
}
|
||||
</style>
|
||||
<body>
|
||||
<a href="about:blank>" target="_blank">CLICK</a>
|
||||
</body>
|
||||
</html>
|
Loading…
Reference in a new issue