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

222
Views
¿Cómo usar chrome.runtime.sendMessage en javascript?

Estoy tratando de usar un trabajador de servicio simple para enviar un mensaje al script de fondo desde el script de contenido

pero cuando trato de enviarlo, no puedo ver el mensaje en la consola del trabajador del servicio

mi contenido.js:

 chrome.runtime.sendMessage("hello")

mi fondo.js:

 console.log("background running") chrome.runtime.onMessage.addListener(function (message, sender, sendResponse) { console.log(message) })

mi manifiesto.json:

 { "manifest_version": 2, "name": "send message", "version": "0.0.1", "content_scripts": [ { "matches": [ "<all_urls>" ], "js": ["content.js"] } ], "background": { "service_worker": "background.js" } }

no se que estoy haciendo mal

gracias por la 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!