Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

269
Visualizações
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 à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda