Skip to content

Instantly share code, notes, and snippets.

@joaodasilva
joaodasilva / main.js
Last active March 1, 2023 19:11
windowjs test for Process.spawn
function run_child_process() {
console.log('Hello from child');
window.title = 'Child window';
Process.parent.addEventListener('message', (event) => {
console.log('[child] Received a message from parent: ' + event);
});
}
function resolveAfterTimeout(millis) {
return new Promise(function(resolve, reject) {
setTimeout(resolve, millis);
});
}
class ChildProcess {
constructor(child, index) {
this.child = child;
this.index = index;