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

272
Vistas
chrome.runtime.onMessage.addListener is not responding

I saved a variable in key: data Console.log(data.key), gives me out my data.

But now I send a message to the background.js from my popup.js and it doesnt read line:

sendResponse(data.key);

result = undefined, I tried to move it out of chrome.storage.local.get("key", function(data) { }) and it worked with a test variable.

Popup.js:

chrome.runtime.sendMessage({from: 'popup',subject: 'ubisoft'}, function (result) {

        window.alert(result)
        
      });

Background.js:

  chrome.runtime.onMessage.addListener((msg, sender,sendResponse) => {

    // First, validate the message's structure.
    if ((msg.from === 'popup') && (msg.subject === 'ubisoft')) {
      // Enable the page-action for the requesting tab.
      chrome.storage.local.get("key", function(data) {
        // Do something with data.key
        console.log(data.key)
        sendResponse(data.key);
      });
    }
  });
about 4 years ago · Santiago Gelvez
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