Skip to content

Instantly share code, notes, and snippets.

@asev
Created July 14, 2015 05:43
Show Gist options
  • Save asev/4bf5d618a5c6b7631551 to your computer and use it in GitHub Desktop.
Save asev/4bf5d618a5c6b7631551 to your computer and use it in GitHub Desktop.
Bitbucket load all diffs in pull request
/* Add this line to bookmarks and use when you see
* "Oops! You've got a lot of code in this diff and it couldn't load with the page."
* on a pull request at Bitbucket.
*/
javascript:(function(){[].forEach.call(document.querySelectorAll(".load-diff"),function(a){a.click()})})();
@ViliusKraujutis
Copy link

Hey, @asev, could you please update it to this:

javascript:(function(){[].forEach.call(document.querySelectorAll(".load-diff-button"),function(a){a.click()})})();

@SokolskyNikita
Copy link

SokolskyNikita commented Feb 25, 2018

Currently the following works:

javascript:(function(){[].forEach.call(document.querySelectorAll(".load-diff"),function(a){a.click()})})();

@ktomk
Copy link

ktomk commented Oct 1, 2019

Additionally if you want to hide all paths which have an equal number of changed lines (+ / - the same):

javascript:(function(){[].forEach.call(document.querySelectorAll("ul#commit-files-summary .commit-file-diff-stats"), function(e) {const v = (i) => parseInt(e.getElementsByTagName("span")[i].textContent.trim(), 10); (0 == v(0) + v(1)) && (e.parentElement.style.display = 'none');});})();

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment