Add spec for cross-origin blockage
This commit is contained in:
parent
e735aa7dee
commit
36989e19f8
2 changed files with 27 additions and 0 deletions
19
spec/fixtures/api/native-window-open-cross-origin.html
vendored
Normal file
19
spec/fixtures/api/native-window-open-cross-origin.html
vendored
Normal file
|
@ -0,0 +1,19 @@
|
|||
<html>
|
||||
<body>
|
||||
<script type="text/javascript" charset="utf-8">
|
||||
const {ipcRenderer} = require('electron')
|
||||
const popup = window.open('http://host')
|
||||
const intervalID = setInterval(function () {
|
||||
try {
|
||||
if (popup.location.toString() !== 'about:blank') {
|
||||
clearInterval(intervalID)
|
||||
ipcRenderer.send('answer', 'did not throw error')
|
||||
}
|
||||
} catch (error) {
|
||||
clearInterval(intervalID)
|
||||
ipcRenderer.send('answer', error.message)
|
||||
}
|
||||
}, 10)
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
Loading…
Add table
Add a link
Reference in a new issue