tratando de hacer una extensión de Chrome que raspe un sitio web pero siempre lo escapa antes de que el contenido esté completamente cargado (intentado después de leer el documento en manifest.json)
cada vez que me llaman me sale:
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); }
también probé:
await finsh_minting_shit(profile,user_id_now);
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); }