// Scrolls the account's Impostazioni down to «Cartella» and the block «Copie esterne» under it (spec §4.10, tappa E2; // composed from mockup 05): the switch, the account's own folder, the files still to copy and «Copia in…». const sleep = (ms) => new Promise((r) => setTimeout(r, ms)); let block = null; for (let i = 0; i < 50 && !block; i++) { block = document.querySelector('.copie-esterne'); if (!block) await sleep(100); } const body = document.querySelector('.corpo'); const folder = block.previousElementSibling || block; body.scrollTop = folder.getBoundingClientRect().top - body.getBoundingClientRect().top + body.scrollTop - 24; await sleep(400); return block.querySelector('.conteggio-copie')?.textContent;