Skip to content

Instantly share code, notes, and snippets.

@JohnCoates
Created June 6, 2016 08:04
Show Gist options
  • Save JohnCoates/b3c13def927d7dc0c5c03c0e6c61ebba to your computer and use it in GitHub Desktop.
Save JohnCoates/b3c13def927d7dc0c5c03c0e6c61ebba to your computer and use it in GitHub Desktop.
Auto-tap load more on YouTube
buttons = document.getElementsByTagName("button");
for (key in buttons) {
button = buttons[key];
attributes = button.attributes
if (attributes != undefined && attributes.getNamedItem('aria-label')) {
label = attributes.getNamedItem('aria-label')
value = String(label.value)
if (value == "Load more\n") {
console.log("clicking load more!");
button.click();
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment