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

386
Views
Obteniendo "Runtime.lastError no verificado: no se pudo establecer la conexión. El extremo receptor no existe", pero el oyente existe

Entonces, estoy tratando de enviar un mensaje desde el script background.js a un script de contenido, pero aparece este error Unchecked runtime.lastError: Could not establish connection. Receiving end does not exist .

fondo.js

 chrome.tabs.query({active: true, currentWindow: true}, function(tabs) { chrome.tabs.sendMessage(tabs[0].id, {data: { message: 'createProfileFrame', userData: userData }}, function(res) { console.log(res); }); })

popup.js (script de contenido)

 const framesContainer = document.getElementById('framesContainer'); chrome.runtime.onMessage.addListener(function(request, sender, sendResponse) { console.log(request); sendResponse(true); if (request.data.message == 'createProfileFrame') { const li = document.createElement('li'); li.style.display = 'block'; const frame = document.createElement('div'); frame.style.backgroundColor = 'white', frame.style.borderRadius = '20px'; frame.style.width = '90%'; frame.style.height = '3rem'; li.appendChild(frame); framesContainer.appendChild(li); } })

ventana emergente.html

 <!DOCTYPE html> <html> <head> <link rel="stylesheet" href="popup.css"> </head> <body> <div class="container"> <ul id="framesContainer"></ul> </div> <script src="popup.js"></script> </body> </html>

manifiesto.json

 { "name": "Extension", "description": "Test extension", "version": "1.0", "manifest_version": 3, "background": { "service_worker": "background.js" }, "permissions": [ "storage", "activeTab", "scripting", "cookies", "webRequest" ], "action": { "default_popup": "popup.html" }, "host_permissions": ["<all_urls>"] }

Leí la documentación varias veces y me parece que todo es correcto, así que no sé qué estoy haciendo mal, agradecería cualquier ayuda.

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!