document.querySelectorAll('button[aria-pressed="true"][aria-label="Viewed"]').forEach(btn => btn.click());
Updated command for 2025 github new UI