35ac7fb8e6
* fix: window.open not overriding parent's webPreferences * test: remove "nativeWindowOpen: false" from renderer tests
21 lines
512 B
HTML
21 lines
512 B
HTML
<html>
|
|
<body>
|
|
<script>
|
|
if (location.hash) {
|
|
window.opener.postMessage('foo', '*');
|
|
} else {
|
|
// `setImmediate` schedules a function to be run on the next UV tick, which
|
|
// ensures that `window.open` is run from `UvRunOnce()`.
|
|
setImmediate(async () => {
|
|
const p = new Promise(resolve => {
|
|
window.addEventListener('message', resolve, { once: true });
|
|
});
|
|
window.open('#foo', '', 'nodeIntegration=no,show=no');
|
|
const e = await p;
|
|
|
|
window.close();
|
|
});
|
|
}
|
|
</script>
|
|
</body>
|
|
</html>
|