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

209
Vistas
Chrome Extension chrome.runtime.onMessage event not working when blur event is triggered on page

I am sending a message on foreground.js via background.js with the following codes, but only messages are tracked when on the page. Messages are not overlapped when you switch to another tab or become blurred. Can you please help?

Background.js

  chrome.tabs.query({ active: true, currentWindow: true }, function (tabs) {

        chrome.tabs.sendMessage(tabs[0].id, { greeting: "hello" }, function (response) {
            console.log(response);
        });


    });

Foreground.js

 chrome.runtime.onMessage.addListener(function(request, sender, sendResponse){
        console.log(request, sender, sendResponse);
        console.log("tıklandı")
        sendResponse({"test":"ok"});
    });

enter image description here The "clicked" text in the picture is written when the message event is triggered. When I click on another area of ​​the page, I cannot send or receive messages.

about 4 years ago · Santiago Trujillo
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