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);
finish_minting_shit()
- (great function name BTW :-0 )