Questions tagged [ipcrenderer]
70 questions
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
1 answer
Function doesn't work when ipcRenderer is used
this is the first time I'm using electron so these could be some dumb questions but I didn't find anything online about it.
So, I have this in my index.html file
0
votes
1 answer
Using window.require('electron') in a render function causes the whole screen to go blank. Electron, React, Material UI
I am attempting to build a program using Electron, React.js, and Material UI. I can get the app to open, and the screen to show as intended. However, when I attempt to use ipcRender in a render component the entire screen goes blank. I can verify…

CapinCole89
- 1
- 2
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
Vscode cant find function defined in contextBridge.exposeInMainWorld
I just started modifying the electron-react-boilerplate project and tried doing the following:
In the App.tsx file I added a button:
const ping = () => {
electron.ipcRenderer.myAwesomePing('Hello world!');
};
const Hello = () => {
return (
…

Florian Baierl
- 2,378
- 3
- 25
- 50
0
votes
1 answer
Send ipcRenderer variable to vue3 page
I have a vue3 app with electron and need to send a variable from the ipcRenderer to my Vue3 page. I cant figure out how to do it especially given vue strips away lots of js. What im trying to do is to save the path of a folder which so far works…

sfokoua
- 15
- 6
0
votes
1 answer
Electron - throttle flow of messages from main to render process
I am currently having some issues receiving an constant stream of active windows from my main process to my renderer process (in Angular). I know receiving second-by-second updates will break my app as it does, so I am trying to throttle it a bit…

methuselah
- 12,766
- 47
- 165
- 315
0
votes
0 answers
How can I solve fs.existsSync is not a function?
I'm getting the error I mentioned above while trying to communicate between electron and react.
In my App.js file:
This is causing the error.
const { ipcRenderer, remote } = require('electron');
console.log('electron', ipcRenderer);
I've two…

Chandler Bing
- 410
- 5
- 25
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
1 answer
invoke a callback function after multiple ipcRenderer events in electronJS
I want to invoke a callback function after two(multiple) ipcRenderer.on() fires. I tired this...
(async () => {
await ipcRenderer.on('all-items-data-fetched', (event, data) => {
itemData = data;
});
await…

user15557745
- 139
- 6
0
votes
1 answer
ipcRenderer not getting triggered
I'm trying to use IPC to communicate between my react component and main electron process.
In component :
export default class A extends React.Component{
.....
openFile = () => {
console.log('test');
ipcRenderer.send('file-command',…

Maifee Ul Asad
- 3,992
- 6
- 38
- 86
0
votes
0 answers
Electron ipcRenderer invoke doesn't work when second-instance is called
In Electron, ipcRenderer.invoke() Does not work after app is opened while an instance is already created. Here is my code:
// Force Single Instance Application
const gotTheLock = app.requestSingleInstanceLock()
if (gotTheLock) {
…

Sennri
- 31
- 5
0
votes
1 answer
Windows.alert() preventing access/data entry into text input field in electron-react app. What is the best way to handle windows.alert?
I have a text input field in an electron-react app. The windows.alert() was being used to through an alert on altering a state given a certain condition. But after throwing the alert, an input text field in a completely separate form would not allow…

nekevss
- 21
- 4
0
votes
2 answers
import { ipcRenderer } from 'electron' produces this error: __dirname is not defined
With this simple vue page: