Skip to content

Answer: How to pass parameters from main process to render processes in Electron

circleoncircles profile image Nutchanon Ninyawee twitter logo github logo ・1 min read

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(;
let data =
twitter logo DISCUSS
markdown guide
Classic DEV Post from Aug 1 '19

Which loading GIF do you prefer?

I made some loading gifs

Nutchanon Ninyawee profile image
Coding Python, Contributing Open Source on a daily basis. In my 20s, I decided to finish my digital delegator.