javascript: | |
document.querySelectorAll('.load-diff-button').forEach(node => node.click()) |
Awesome. Will save me quite a lot of carpel-tunnel clicks.
Thank you. Bookmarked.
Load first 50 files with only "Load Diff" button, without reason (this exclude large files, deleted files and so on):
Array.from(document.querySelectorAll('.js-diff-load-button-container')).filter(container => !container.querySelector('.hidden-diff-reason')).slice(0, 50).forEach(container => container.querySelector('.load-diff-button').click())
awesome.would have received lot of upvotes in stackoverflow
I added your code to my gist here: https://gist.github.com/ElectricRCAircraftGuy/0a788876da1386ca0daecbe78b4feb44
oh, if you're keeping a collection around. here is another i use pretty regularly:
https://gist.github.com/juanca/669c59f15a17e20022b8bd78b12889e6
Only click on files which are not yet marked as reviewed.
Array.from(document.querySelectorAll('.file')).filter(container => !container.querySelector('input.js-reviewed-checkbox:checked')).filter(container => container.querySelector('.load-diff-button')).forEach(node => node.click())
Nope, that doesn't work :/
Ah ha!
Array.from(document.querySelectorAll('.file')).filter(container => !container.querySelector('input.js-reviewed-checkbox:checked')).forEach(pnode => pnode.querySelectorAll('.load-diff-button').forEach(node => node.click()))
Well, that really must be a massive PR.
Mine was ~1.6k files changed and I never hit that...
Woah, I guess we could batch the requests for x files at a time? Might seem a bit excessive for a bookmark though. Up to anyone else if they want to improve on the script.
Thanks! I just put the Javascript in my browser URI field and voila!
I had to modify a little:
Array.from(document.getElementsByClassName('load-diff-button')).map(button => button.click())`
The original from 2017 above seems to work for me. Thanks!
Thanks, I use this all of the time.