Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

197
Vistas
Electron Device Access "serial-port-added" / 'serial-port-removed' not firing

I'm running Electron ^18.0.1. I'm trying to get the events to "serial-port-added" / "serial-port-removed". From what I understand from the documentation the events should fire off when devices are connected/disconnect while the "select-serial-port" event has been fired but before the device selection callback has been returned.

My question: I haven't been able to figure out how to get the events to fire off. I'm not sure If have missunderstood the documentation/doing somthing wrong or if it's a bug?

 mainWindow.webContents.session.on('select-serial-port', (event, portList, webContents, callback) => {
    event.preventDefault()
    if (portList && portList.length > 0) {

      // Tried many, many things before running the callback.

      callback(portList[0].portId)
    } else {
      callback('') //Could not find any matching devices
    }
  })

  mainWindow.webContents.session.on('serial-port-added', (event, port) => { // <-- Event not firing?
    console.log('serial-port-added FIRED WITH', port)
  })

  mainWindow.webContents.session.on('serial-port-removed', (event, port) => { // <-- Event not firing?
    console.log('serial-port-removed FIRED WITH', port)

about 4 years ago · Juan Pablo Isaza
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda