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

268
Views
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
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!