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

307
Views
buscando inyectar un script en el chat de contracción pero estoy atascado, ¿necesito background.js o hay una manera de simplemente inyectar el script de contenido?

un poco perdido en este momento he estado en google durante 2 horas soy nuevo en la codificación y quiero inyectar algo que agregue un botón a cada chat de contracción 'al pasar el mouse'

Manifiesto.json

 { "name": "Hello Extensions", "description": "Base Level Extension", "version": "1.0", "manifest_version": 3, "action": { "default_popup": "popup.html", "default_icon": "hello.png" }, "background": { "service_worker": "content-script.js" }, "permissions": ["tabs"], "content_scripts": [{ "matches": ["https://*.twitch.tv/*"], "exclude_globs": ["https://www.twitch.tv/directory/*", "https://www.twitch.tv/p/*", "https://www.twitch.tv/products/*", "https://www.twitch.tv/*/manager*", "https://www.twitch.tv/*/dashboard", "https://www.twitch.tv/broadcast", "https://www.twitch.tv/messages/*", "https://www.twitch.tv/settings"], "js": ["content-script.js"], "run_at": "document_end" } ] }

Contenido-script.js

 var config = {attributes: false, childList: true, characterData: false}; var htmlBody = $("body")[0]; var chatLoadedObserver = new MutationObserver(function (mutations, observer) { mutations.forEach(function (mutation) { var chatSelector = $(".chat-line__message"); if (chatSelector.length > 0) { // Select the node element. console.log("new chat message.") var target = chatSelector[0]; // Pass in the target node, as well as the observer options bookmark.observe(target, config); // Unregister chatLoadedObserver. We don't need to check for the chat element anymore. observer.disconnect(); } }) }); chatLoadedObserver.observe(htmlBody, config);

¿Qué más necesito para hacer esto funcional?

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!