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

296
Views
Run time property in manifest.json not loading script after page load

Context - Chrome extension development

Goal – Access DOM elements when page has fully loaded. The page I'm accessing is heavy and I need to acccess the DOM when everything has loaded.

What I've done so far

I have set run_at property within my manifest.json to document_idle. However, this does not work as script returns error that it cannot find the element in question

manifest.json

"content_scripts": [
        {
         "js": ["contentScript.js"],
         "run_at": "document_idle"
        }

The the only thing that seems to work is the following

contentScript.js

setTimeout(() => {
const recordNameEl = document.querySelectorAll('[data="sectionId"]');
const recordNameString = recordNameEl[1].textContent;
const nameArray = recordNameString.split(' ');
console.log(nameArray[0]);
 }, 5000);

The above solution feels hacky. Whats best solution to have my script run when the page has completed loaded?

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!