Company logo
  • Empleos
  • Bootcamp
  • Acerca de nosotros
  • Para profesionales
    • Inicio
    • Empleos
    • Cursos y retos
    • Preguntas
    • Profesores
    • Bootcamp
  • Para empresas
    • Inicio
    • Nuestro proceso
    • Planes
    • Pruebas
    • Nómina
    • Blog
    • Comercial
    • Calculadora

0

161
Vistas
chrome extension: null parameter error on querySelector on content script

I am creating a chrome extension that will interact with twitch drops and notify me if the drop is ready for collection. I am injecting a content script fetch attributes of a particular element by its class but it shows Cannot read properties of null (reading 'getAttribute'). Here is my content.js code:

var element = document.querySelector(".juerA");
var val = element.getAttribute('value');
console.log(val);

If I run the same code on the console, it works fine. I have tried using "run_at" : "document_end" but it doesn't work. I have also checked if the extension works if I change the matches of the content script with other web pages and it works.

7 months ago · Juan Pablo Isaza
Responde la pregunta
Encuentra empleos remotos