Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

256
Vistas
Can't print the innerHTML content throught an extension, but it works in my console

I'm creating an extension in Firefox, I'm trying to reading the content using ElementByClassName function. Like this.

console.log(document.getElementsByClassName('flip-card-back')[0].innerHTML)

this works perfectlly in my console and return the result expected. Nevertheless when I'm implementing this in my extension, this doesn't work.

This is what I tried.

console.log('test')
console.log(document.getElementsByClassName('flip-card-back')[0].innerHTML)

window.addEventListener('load', function () {
    var eles = document.getElementsByClassName('flip-card-back')[0].innerHTML;
    console.log(eles);
})

The first console is printed correctly, unlike the other ones.

Notice that I've used window event listener function to wait for the DOM to load. But still didn't work. I also printed the HTMLColecction itself, (without tanking the item 0) and it seems to work. What I'm doing wrong?

This is the page I'm trying to take the content from. here

Thanks!

about 4 years ago · Juan Pablo Isaza
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda