Add failing spec for webviewTag inheritance
This commit is contained in:
parent
bde13353fb
commit
e817dbf50a
3 changed files with 46 additions and 0 deletions
|
@ -309,6 +309,26 @@ describe('chromium feature', function () {
|
||||||
b = window.open(windowUrl, '', 'javascript=no,show=no')
|
b = window.open(windowUrl, '', 'javascript=no,show=no')
|
||||||
})
|
})
|
||||||
|
|
||||||
|
it('disables the <webview> tag when it is disabled on the parent window', function (done) {
|
||||||
|
let b
|
||||||
|
listener = function (event) {
|
||||||
|
assert.equal(event.data.isWebViewGlobalUndefined, true)
|
||||||
|
b.close()
|
||||||
|
done()
|
||||||
|
}
|
||||||
|
window.addEventListener('message', listener)
|
||||||
|
|
||||||
|
var windowUrl = require('url').format({
|
||||||
|
pathname: `${fixtures}/pages/window-opener-no-webview-tag.html`,
|
||||||
|
protocol: 'file',
|
||||||
|
query: {
|
||||||
|
p: `${fixtures}/pages/window-opener-webview.html`
|
||||||
|
},
|
||||||
|
slashes: true
|
||||||
|
})
|
||||||
|
b = window.open(windowUrl, '', 'webviewTag=no,nodeIntegration=yes,show=no')
|
||||||
|
})
|
||||||
|
|
||||||
it('does not override child options', function (done) {
|
it('does not override child options', function (done) {
|
||||||
var b, size
|
var b, size
|
||||||
size = {
|
size = {
|
||||||
|
|
15
spec/fixtures/pages/window-opener-no-webview-tag.html
vendored
Normal file
15
spec/fixtures/pages/window-opener-no-webview-tag.html
vendored
Normal file
|
@ -0,0 +1,15 @@
|
||||||
|
<html>
|
||||||
|
<body>
|
||||||
|
<script type="text/javascript" charset="utf-8">
|
||||||
|
var windowUrl = decodeURIComponent(window.location.search.substring(3))
|
||||||
|
var opened = window.open('file://' + windowUrl, '', 'webviewTag=yes,nodeIntegration=yes,show=no')
|
||||||
|
window.addEventListener('message', function (event) {
|
||||||
|
try {
|
||||||
|
opened.close()
|
||||||
|
} finally {
|
||||||
|
window.opener.postMessage(event.data, '*')
|
||||||
|
}
|
||||||
|
})
|
||||||
|
</script>
|
||||||
|
</body>
|
||||||
|
</html>
|
11
spec/fixtures/pages/window-opener-webview.html
vendored
Normal file
11
spec/fixtures/pages/window-opener-webview.html
vendored
Normal file
|
@ -0,0 +1,11 @@
|
||||||
|
<html>
|
||||||
|
<body>
|
||||||
|
<script type="text/javascript" charset="utf-8">
|
||||||
|
document.addEventListener('DOMContentLoaded', function (event) {
|
||||||
|
window.opener.postMessage({
|
||||||
|
isWebViewGlobalUndefined: typeof WebView === 'undefined'
|
||||||
|
}, '*')
|
||||||
|
})
|
||||||
|
</script>
|
||||||
|
</body>
|
||||||
|
</html>
|
Loading…
Add table
Add a link
Reference in a new issue