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

206
Views
No se puede acceder a chrome.tabs.query en el script background.js

No puedo por mi vida resolver esto. Estoy tratando de usar chrome.tabs.query en mi página de fondo para obtener la pestaña actual para realizar una acción al hacer clic en un botón. La llamada a la pestaña produce el siguiente error Error handling response: TypeError: Cannot read properties of undefined (reading 'id') Según tengo entendido, el valor de retorno no está definido. Mi pregunta es ¿cómo obtengo el valor de la ficha? ¿Puedo enviar el valor de la pestaña a través del mensaje popup.js ?

emergente.js

 document.addEventListener("DOMContentLoaded", function() { setOptions(); document.getElementById("buttonScan").addEventListener("click", function() { loadOptions(); chrome.runtime.sendMessage({ "message": "getWords", "remove": true, }); }); });

fondo.js

 chrome.runtime.onMessage.addListener(function(request, sender, sendResponse) { if ("getWords" == request.message) { chrome.tabs.query({ "active": true, "currentWindow": true }, function(tabs) { chrome.tabs.sendMessage(tabs[0].id, { "message": "returnWords", "remove": request.remove, "keywords": chrome.storage.local.get("keywords"), "foreground": chrome.storage.local.get("foreground") || "red", "background": chrome.storage.local.get("background") || "#lightblue", }); } ); } });
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!