electron/spec/fixtures/api/native-window-open-cross-or...

20 строки
549 B
HTML

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