Add spec for reloading opened window cross-origin

This commit is contained in:
Kevin Sawicki 2017-07-10 16:59:49 -07:00
parent 0c8f773dec
commit 3925bfde8e
5 changed files with 87 additions and 0 deletions

View file

@ -0,0 +1,15 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title></title>
</head>
<body>
foo
<script type="text/javascript">
setTimeout(function () {
window.location = 'bar://page'
})
</script>
</body>
</html>

View file

@ -0,0 +1,10 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title></title>
</head>
<body>
bar
</body>
</html>

View file

@ -0,0 +1,12 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title></title>
</head>
<body>
<script>
window.open('foo://page')
</script>
</body>
</html>

View file

@ -0,0 +1,8 @@
const {ipcRenderer} = require('electron')
setImmediate(function () {
if (window.location.toString() === 'bar://page') {
ipcRenderer.send('answer', process.argv, typeof global.process)
window.close()
}
})