benjamincharity
1/19/2018 - 2:48 PM

Collapse all file panels when viewing a PR on Github

Open the dev tools console and paste the following snippet:

javascript:void((function(d){d.querySelectorAll('div:not(.Details--on) > div.file-header[data-path*="spec"] > div.file-actions > button').forEach(function(x){x.click()});})(document));
javascript:void((function(d){d.querySelectorAll('div:not(.Details--on) > div.file-header > div.file-actions > button').forEach(function(x){x.click()});})(document));
// Open all
$$('div.file-header > div.file-actions .js-details-target').map(function(x){x.click()});

// Close all open
$$('div:not(.Details--on) > div.file-header > div.file-actions .js-details-target').map(function(x){x.click()});