SOLVED: Trigger ipcRenderer event from devtools


I need to trigger this event from devtools. It gets triggered when called from the main process (js).
For debugging, I want to do it from devtools console.

ipcRenderer.on('get-holdings', (event, arg) => {
	var holdings;
	$.getJSON('', function(res){
		holdings =;
		ipcRenderer.send('save-holdings', holdings);

Please help!

I looking for the code that needs to be put into the devtools console to trigger the get-holdings event.


Borrowing ideas from the code in devtron, I solved it using this in the pre-load script

window.__electron = require('electron');

Then, I could simply do the following:

win = window.__electron.remote.getCurrentWindow()
win.webContents.send('get-holdings', 'get holdings!');