Github: toggle and un-toggle all viewed files

PHOTO EMBED

Thu Mar 06 2025 16:17:39 GMT+0000 (Coordinated Universal Time)

Saved by @hungj

// toggle all to viewed
document.querySelectorAll('.js-reviewed-checkbox').forEach((elem => {
    if (elem.checked) { return }
    var clickEvent = new MouseEvent('click');
    elem.dispatchEvent(clickEvent);
}))

// toggle all to not-viewed
document.querySelectorAll('.js-reviewed-checkbox').forEach((elem => {
    if (!elem.checked) { return }
    var clickEvent = new MouseEvent('click');
    elem.dispatchEvent(clickEvent);
}))
content_copyCOPY

Github PR Review View

https://github.com/refined-github/refined-github/issues/2444