electron/spec/fixtures/api/native-window-open-cross-origin.html

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

20 lines
549 B
HTML
Raw Normal View History

2017-05-24 20:07:50 +00:00
<html>
<body>
<script type="text/javascript" charset="utf-8">
const {ipcRenderer} = require('electron')
const popup = window.open('http://127.0.0.1')
2017-05-24 20:07:50 +00:00
const intervalID = setInterval(function () {
try {
if (popup.location.toString() !== 'about:blank') {
clearInterval(intervalID)
2017-05-25 16:39:40 +00:00
ipcRenderer.send('answer', `Did not throw error accessing location: ${popup.location}`)
2017-05-24 20:07:50 +00:00
}
} catch (error) {
clearInterval(intervalID)
ipcRenderer.send('answer', error.message)
}
}, 10)
</script>
</body>
</html>