Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

203
Views
ipcMain receiving nothing from ipcRenderer

I'm trying to do a very simple communication between ipcRenderer and IPCMain but it's not working ! can someone tell me why ?

GALLERY.JS

const { ipcRenderer } = require("electron");


document.addEventListener('DOMContentLoaded', (e) => {
    ipcRenderer.send('test');
});

I really don't understand why nothing is printed in my console

GALERYCONTROLLER.JS

const { ipcMain} = require('electron');
const userId;
const Axios = require('axios')



ipcMain.on('test', (e) =>{
    console.log('droneDataGallery received')
   })

});

gallery.ejs

<link rel="stylesheet" href="../assets/css/GalleryPage.css"></link>

<div class='galleryPage'>

</div>

<script src="./../assets/js/gallery.js"></script>

Thanks a lot for your help !

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

Assuming you use the latest version of Electron, you need to expose the ipc messaging system to your HTML (gallery.js) code through the contextBrige object at the preload.js level. This is very well explained here and it worked great for me. Of course, it implies some extra plumbing.

about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!