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

178
Views
Chrome Extension js code works only in console

I'm very new to making chrome extension, not sure why but my javascript code returns on start

Cannot read properties of undefined

(reading cells), but in console everything works fine.

if(document.getElementById('pricelist')){
    var elementTable = document.getElementById('pricelist').tBodies[0];

    for (let i = 0; i < 25; i++) {
        for (let x = 1; x < 14; x++){
            let value = parseInt(elementTable.rows[i].cells[x].innerText);
            let mainValue = parseInt(elementTable.rows[i].cells[2].innerText);
            let diference = mainValue - value;
            let percentage = (diference/steamValue)*100;
            let newValue = value + "(" + percentage + ")";
            document.getElementById('pricelist').tBodies[0].rows[i].cells[x].innerHTML = newValue
        }    
    }
}

json:

{
    "name": "calculator",
    "version": "1.0",
    "manifest_version": 2,
    "content_scripts": [
        {
            "matches": ["https://cmywebsite.com"],
            "js": ["content.js"]
        }
    ]
}
about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

Turns out a website I was using on had Web Scaping detection and was blocking me

about 4 years ago · Juan Pablo Isaza Report
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!