I have an Electron app that can open different windows.
On app launch the app open a set of window(s) (that load the same HTML and JS files) but with params to change ea
Using query string along with win.loadFile()
,
// main process or renderer process 1
data = {"age": 12, "healthy": true}
let win = new BrowserWindow({
webPreferences: {
nodeIntegration: true
}
});
win.loadFile("public/print.html", {query: {"data": JSON.stringify(data)}});
// renderer process 2
const querystring = require('querystring');
let query = querystring.parse(global.location.search);
let data = JSON.parse(query['?data'])