Questions tagged [ipcmain]
36 questions
6
votes
0 answers
Are Electron ipc messages ordered?
Are there any ordering guarantees of ipc messages in Electron? If so, what are they?
For instance, in main:
window.webContents.send('channel-a', 1)
window.webContents.send('channel-a', 2)
And in the renderer:
ipcRenderer.on('channel-a', (_event,…

Betamos
- 26,448
- 9
- 23
- 28
6
votes
3 answers
How do I seperate ipcMain.on() functions in different file from main.js
I'm creating an electron app with vuejs as frontend. How can I create all the ipcMain.on() functions in a separate file from the main.js. I want this for a more clean code structure.
The app has to work offline so I need to store the data in a local…

Svekke
- 101
- 1
- 7
6
votes
2 answers
Why is my ipcMain not sending to ipcRenderer in Electron?
New to electron I've figured out how to send from Renderer to Main but I'm trying to learn how to go from Main to Renderer. In my research I've read:
IPC send from main process to renderer and tried:
main.js:
const { app, ipcMain, Menu } =…

DᴀʀᴛʜVᴀᴅᴇʀ
- 7,681
- 17
- 73
- 127
4
votes
2 answers
How to differentiate two ipc renderer in one ipc main (same channel)
I want to detect the specific frame/browserWindow. I have one main process and two browser windows which all three are sending message to each other using same channel . in IPCMain I need to detect one of them. I saw that IPCmain event has a…

Samira Arabgol
- 359
- 2
- 5
- 22
2
votes
3 answers
fs.readdir inside ipcMain.handle does not return
it always returns undefined, any idea please?
i need the return inside fs.reddir but relative to ipcMain
//main
ipcMain.handle('pegaDirRomSalvo', async (event, argx=0) => {
fs.readFile('dataCR.txt', 'utf8', function (err,data) {
if (err)…

Clerison Campos
- 25
- 6
2
votes
1 answer
Electron: Can same channel name use for ipcMain.on and ipcMain.handle?
Can we register the same channel for ipcMain.on method and ipcMain.handle()?
For eg:
ipcMain.handle('test', async(event,args) => {
let result = await somePromise();
return result;
});
ipcMain.on('test', async(event,args) => {
…

Akash Sethiya
- 73
- 1
- 4
2
votes
0 answers
spawn python process is Reloading the page in electron
[Update]: Before reloading, fora fraction of second a warning [violation] 'click' hander took xx ms is showinf. (found out from screen recording)
I am using Electron with React.
To communicate with main process(Electron) and renderer(React) i am…

Shantanu vidwans
- 43
- 1
- 6
2
votes
2 answers
Is there a function to send electron 6 data to an angular 8 component?
I need to send information to an angular component in order to do an "automatic" login,
I can send component data to the electron process using the
IPCRederer (on component) and IPCMain (on 'electron' side), but I can't
use in the opposite way that…

Bruno Furukawa
- 21
- 5
1
vote
1 answer
I am getting an error when using ipcRenderer (typeerror cannot read properties of undefined (reading 'send'))
I am getting an error when using ipcRenderer (typeerror cannot read properties of undefined (reading 'send')). I feel the error is in ( const mainWindowTemplate) , I don't know why this error is poping up because the other times I used ipcRenderer…

the python guy
- 65
- 1
- 9
1
vote
1 answer
electron app json data to renderer using ipc
i am new to electron so im sorry if my question is childish
but i have sent some user inout data as object from renderer to main to store in json file (electron-db)
but i want to show all data in a table
i tired this by event.reply but it giving my…

Warlord
- 17
- 6
1
vote
1 answer
ipcRenderer not receiving the message from webContents.send (Electron)
In the main window of my program, I have a button that, if clicked, creates a new, additional window. When this new window finishes loading, I want to send a message to ipcRenderer; however, I have not been able so far to make ipcRenderer able to…

notexactly
- 918
- 1
- 5
- 21
1
vote
1 answer
Electron FFmpeg progress handling
I have an Electron app (with Angular).
I am new to Electron and all this inter-process event handling.
My problem is that I have this ipcMain handler(main process) (that I 'Invoke' from an Angular service) :
ipcMain.handle('video-audio-merge',…

Ano
- 13
- 2
1
vote
0 answers
Electron app: TypeError fs.existsSync is not a function
I am building a desktop application in Electron using React and SQLite3. My configuration is as follows:
node: v14.17.4
electron: 13.2.1
react: 17.0.2
sqlite3: ^5.0.2
I am trying to enable the communication between the main side and the renderer…

El_Merendero
- 603
- 3
- 14
- 28
1
vote
2 answers
How to update react state when using contextBridge/preload in electron app
I have an electron application that is using react. I am using the contextBridge in preload.js. I would like to pass a variable from app.js through the bridge to a function in the main process; which returns a value to the bridge and back to app.js…

DMonde
- 71
- 8
1
vote
0 answers
Why send method of Electron does not working from the main process?
I'm in big trouble. I checked other solutions but nothing helped me.
I don't understand why the "send" method doesn't work here. No exceptions, no messages or anything else.
I tried wrapping the send method in another method but it failed.
I tried…

Yefis
- 11
- 3