I like how I can alt+click the collapse/expand button when viewing files changed in a pull request. I would like to also be able to alt+click the "Display the source diff" and the "Display the rich diff" buttons to quickly switch diff viewers for all files on the page (where applicable).
We actually have a feature that default to the rich diff, but it caused the URL to change and the page to scroll unexpectedly. https://github.com/sindresorhus/refined-github/issues/2041
I think if someone fixes that feature you wouldn't need this one.
The opposite may also be true. If alt+click were supported then users could easily swap all from one to the other thereby mitigating somewhat the need to load rich diff by default. Plus, even with defaulting to rich diff, how would someone quickly go back to source diff (e.g. for view the raw source of markdown files for documentation, etc.).
In our case, that would be amazing to visualize screenshot diffs for visual testing in a PR. Right now they are all closed by default, need to click on each one...
This can be added, but it can't just .click() all the elements because it would cause https://github.com/sindresorhus/refined-github/issues/2041
It'd have to load the page manually (with fetchDom) and change the selected button. More info in https://github.com/sindresorhus/refined-github/issues/2041#issuecomment-493492294
Interesting. I've been using the following snippet as a custom search engine in chrome (mapped to the ghrd keyword) and I haven't seen any issues. I use it a good amount, even on large PRs with lots of images.
javascript: document.querySelectorAll('.js-rendered').forEach(button => button.click());