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

205
Views
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
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!