Questions tagged [ipcmain]
36 questions
1
vote
0 answers
Electron | Error invoking remote method 'some-name'
I'm trying to implement in my electron application.
In main.ts :
ipcMain.handle('some-name', async (event, someArgument) => {
console.log("--------------------")
console.log(someArgument)
console.log("--------------------")
return…

Maifee Ul Asad
- 3,992
- 6
- 38
- 86
1
vote
1 answer
How to move ipcMain.on calls outside the main.js file
I am working on a project with Electron and React. I am going to be making multiple calls to the database via ipcMain and ipcRenderer so I moved the calls for ipcMain to another file(ipcMainHandler.js).
The challenge I am facing now is how to send…

David Essien
- 1,463
- 4
- 22
- 36
1
vote
1 answer
using arg beyond ipcRenderer electron?
So I have this code and the arg is getting sent through from Main.
ipcRenderer.send('asynchronous-message', 'async ping')
ipcRenderer.on('asynchronous-reply', (event, arg) => {
console.log(arg);
});
I would like to be able to use…

sjjk001
- 175
- 2
- 12
1
vote
1 answer
ipcMain listener not registering correctly
Am having some troubles with ipc messages between the main and renderer processes in an electron app.
The ipcRenderer is sending the message correctly (I can see it from devtron) but the ipcMain is not listening to anything
code in main.js
const…

FidelVe
- 45
- 4
1
vote
0 answers
Issue with Electron ipcRenderer.send
I have an Electron app. It sends via a ipcRenderer.send in renderer.js a download event to an ipcMain.on listener in index.js:
renderer.js:
for (var i=0; i < data3.projects.length; i++) {
var project = data3.projects[i];
for (var j=0; j <…

marcvander
- 479
- 4
- 17
0
votes
1 answer
How to send parameters to API url in electron?
I have created an Electron app and I am new at this. I am trying to get inputs from a user using HTML. Then, I want to send these inputs to main.js after clicking the button. In main.js I am trying to send a port using endpoint. This is HTML…

RYldz
- 1
- 2
0
votes
1 answer
Electron with React - ipcRenderer receives a reply from a previous message to ipcMain?
So I'm pretty new to Electron, and my goal is to have a completely offline application that effectively queries and displays results from a loaded SQLite file (hence the questionable SQL practices here).
I am able to query my database and get…

firefly
- 3
- 2
0
votes
1 answer
Electronjs ipcRenderer.on not working properly
I am trying to send data from the main process to the renderer and the ipcRenderer.on function is being executed but the data is undefined...
This is the code to send the data:
mainWindow.webContents.on("did-finish-load", () => {
let name =…

plex
- 15
- 3
0
votes
2 answers
Issue while sending message from preload.js to main.js using ipcRenderer and ipcmain
i am beginner in desktop apps development with electron, when i try to send message from preload script to main.js using ipcRenderer and ipcMain in main.js below details shows up in VScode terminal and nothing happens(no event occurs) not even…

Aaqib Javed
- 33
- 3
0
votes
1 answer
electron open default file browser window without returning anything
I am working on an electron app that can open a directory file picker and return a value, like how this question does it: Electron - Open Folder Dialog
ipcMain.on('selectDirectory', function() {
dir = dialog.showOpenDialog(mainWindow, {
…

Martin
- 1,336
- 4
- 32
- 69
0
votes
1 answer
One ipcMain.on() works in the same file while the other doesn't work?
I am developing an app using Electron and vue.
I use this solution to communicate between main and render, so I have three files, preload.js , main and renderer.
// preload.js
const { contextBridge, ipcRenderer } =…

FlyGinger
- 1
- 1
0
votes
2 answers
Passing data from server to html with Electron/Nodejs
I'm using preload and renderer js to pass data from html to server. I have a main window and I open another window (add window). I take data from add window and pass it to server. I receive the data on server, but I don't know how to send callback…

Zeghra
- 447
- 5
- 14
0
votes
2 answers
Electron: How to get webContents (to check on backgroundThrottling)?
To check on the state of backgroundThrottling I want to access the webContents inside an event handler:
window.addEventListener('blur', ()=>{
if(window.webContents.backgroundThrottling)
...
});
But when the event occurs I get the error…

Sadko
- 166
- 9
0
votes
0 answers
How to receive data from preload.js to renderer.js
I'm working on a button click that opens a dialog to get folder root. I'm currently using invoke/handle. I created a promise function to return my data but not sure how to move my data from preload.js to…

Nellz
- 29
- 6
0
votes
0 answers
Electron JS running time consuming process in the back
TLDR
I am using reZach's repo (https://github.com/reZach/secure-electron-template) as a starting guide and it works so far so good. I am able to communicate back and forth ipcMain, ipcRenderer and React typescripts.
However, I still lack of many…

4 Leave Cover
- 1,248
- 12
- 40
- 83