Skip to content

Instantly share code, notes, and snippets.

@danielyaa5
Last active March 4, 2020 20:18
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save danielyaa5/98fa2ea03aa1920e4c7e2998738348b2 to your computer and use it in GitHub Desktop.
Save danielyaa5/98fa2ea03aa1920e4c7e2998738348b2 to your computer and use it in GitHub Desktop.
const delay = (ms) => {
return new Promise(resolve => setTimeout(resolve, ms));
}
const getExpandButtons = () => {
return Array.from(document.querySelectorAll("[title='Expand Down']")).concat(Array.from(document.querySelectorAll("[title='Expand All']")))
}
const expandAll = async () => {
let expand_buttons = getExpandButtons();
while (expand_buttons.length) {
for (let i = 0; i < expand_buttons.length; i++) {
expand_buttons[i].click()
await delay(50)
}
expand_buttons = getExpandButtons();
}
}
expandAll();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment