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

105
Views
await is only valid in async functions and the top level bodies of modules

trying to make a chrome extension that scrapes a website but it always scapes it before the content is fully loaded (tried after document read thing in manifest.json)

everytime that is getting called I am getting:

await is only valid in async functions and the top level bodies of modules
const sleepz = (ms = 0) => {
    return new Promise(r => setTimeout(r, ms));
};

const finsh_minting_shit = async(profile,user_id_now) => {
  console.log("das huhn hat ein ei gelegt");
  await sleepz(4000);
  console.log("RuehrEi")
});

window.onload = function() {
  finsh_minting_shit(profile,user_id_now);
}

also tried:

await finsh_minting_shit(profile,user_id_now);
about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

const sleepz = (ms = 0) => {
    return new Promise(r => setTimeout(r, ms));
};

const finsh_minting_shit = async(profile,user_id_now) => {
  console.log("das huhn hat ein ei gelegt");
  console.log("RuehrEi")
});

window.onload = function() {
  await sleepz(4000);
  finsh_minting_shit(profile,user_id_now);
}
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!