Last active
August 5, 2020 18:29
-
-
Save RyanFleck/601f73a96a9f78193ccbd61db33d510c to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ==UserScript== | |
// @name PR ExpandR | |
// @namespace http://ryanfleck.ca/ | |
// @version 1.0 | |
// @description Expand all GitHub PR conversations. | |
// @author Ryan Fleck | |
// @match https://github.com/*/pull/* | |
// ==/UserScript== | |
var interval = 3000; | |
function expand_convos(){ | |
var buttons = document.getElementsByTagName('button'); | |
for(let i=0; i<buttons.length; i++){ | |
if(buttons[i].textContent.trim().includes("hidden")){ | |
window.setTimeout(function(){ | |
console.log("Clicking button to expand: [ "+buttons[i].textContent.trim()+" ]."); | |
buttons[i].click(); | |
}, 400); | |
} | |
} | |
window.setTimeout(expand_convos, interval); | |
} | |
(function() { | |
'use strict'; | |
console.log("PR Detected, searching for hidden items every "+(interval/1000)+" seconds."); | |
expand_convos(); | |
})(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment