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

802
Views
Chrome Extension: Uncaught (in promise) Error: Could not establish connection. Receiving end does not exist

I am trying to pass data from background.js to popup.js, in background file it is giving the error:

Uncaught (in promise) Error: Could not establish connection. Receiving end does not exist.

Code is given below:

background.js

var currentUrl = '';

chrome.tabs.query(
    {
     lastFocusedWindow: true,
     active: true
    },
    function (tabs)
    {
        console.log('Active Tab')
        currentUrl = tabs[0].url        
        chrome.runtime.sendMessage({
            msg: "From Background"
         })
        
    });

popup.js

document.addEventListener("DOMContentLoaded", function() {
    chrome.runtime.onMessage.addListener(function(request, sender, sendResponse){
        console.log("From popup.js")
        console.log(request.msg)
     })
}); 

Manifest

 "manifest_version": 3,
    // "icons": {
    //     "16": "/images/icon-16x16.png",
    //     "32": "/images/icon-32x32.png",
    //     "48": "/images/icon-48x48.png",
    //     "128": "/images/icon-128x128.png"
    // },
    "background": {
        "service_worker": "background.js"
    },
    "action": {
        "default_popup": "index.html",
        "default_title": "Agile SEO Super Cluster",
        "default_icon": {
            "16": "16x16.png",
            "32": "32x32.png"
        }
    },
    "permissions": [
        "storage",
        "activeTab",
        "scripting",
        "tabs"
    ],
    "host_permissions": [
        "https://www.google.com/*"
    ]
}
about 4 years ago · Juan Pablo Isaza
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!