Substack: espandi automaticamente "Read more"
Fa clic automaticamente su "Read more" e "Show more" così l'intero post è subito visibile.
Codice da copiare
// Auto-click "Read more" / "Show more" toggles inside the post body
(function () {
function expand() {
document.querySelectorAll('button, a[role="button"]').forEach(function (b) {
if (b.dataset.jzSubExpanded) { return; }
var t = (b.textContent || '').trim().toLowerCase();
if (t === 'read more' || t === 'show more' || t === 'continue reading'
|| t.startsWith('read more') || t.startsWith('show more')) {
b.dataset.jzSubExpanded = '1';
try { b.click(); } catch (e) {}
}
});
}
expand();
var obs = new MutationObserver(function () {
clearTimeout(window.__jzSubExpand);
window.__jzSubExpand = setTimeout(expand, 500);
});
obs.observe(document.body, { childList: true, subtree: true });
})();
Come usare questo esempio
- Copia il codice con il pulsante qui sopra.
- Installa JustZix (2 minuti) e apri l'estensione sulla pagina di destinazione.
- Aggiungi una nuova regola corrispondente a quella pagina.
- Incolla il codice nel pannello JavaScript della regola e salva — viene eseguito a ogni visita della pagina.
Valuta questo esempio
Nessuna valutazione — sii il primo.