Mastodon: auto-expand content warnings
Clicks the "Show more" buttons on CW posts for you so you do not need extra taps to read.
Code to copy
// Auto-click "Show more" / spoiler buttons to expand CW content
(function () {
function expand() {
document.querySelectorAll('button.status__content__spoiler-link').forEach(function (b) {
if (b.dataset.jzExpanded) { return; }
var label = (b.textContent || '').toLowerCase();
if (label.indexOf('show more') !== -1 || label.indexOf('pokaż więcej') !== -1 || label.indexOf('mehr anzeigen') !== -1 || label.indexOf('voir plus') !== -1) {
b.dataset.jzExpanded = '1';
b.click();
}
});
}
expand();
var obs = new MutationObserver(expand);
obs.observe(document.body, { childList: true, subtree: true });
})();
How to use this example
- Copy the code with the button above.
- Install JustZix (2 minutes) and open the extension on the target page.
- Add a new rule matching that page.
- Paste the code into the rule's JavaScript panel and save — it runs on every page visit.
Rate this example
No ratings yet — be the first.