Communicate between parent and child renderer process Electron JS
问题 Suppose we have the following 2 BrowserWindow instances created in main process: let fooA = new BrowserWindow({width:800,height:800}); fooA.loadUrl(url.format({ pathname: path.join(__dirname, './a.html'), protocol: 'file:', slashes: true })); let fooB = new BrowserWindow({parent:fooA}); fooB.loadUrl(url.format({ pathname: path.join(__dirname, './b.html'), protocol: 'file:', slashes: true })); As you can see fooB is child of fooA Now each browsers window html file is associated with a renderer