Skip to content

Instantly share code, notes, and snippets.

@dvassallo
Created August 31, 2021 09:16
Show Gist options
  • Save dvassallo/bcadf5d8efff8593a502d0f4830b3c9c to your computer and use it in GitHub Desktop.
Save dvassallo/bcadf5d8efff8593a502d0f4830b3c9c to your computer and use it in GitHub Desktop.
Add button to tweets
let tweets = document.querySelectorAll('article div [aria-label$="Reply"]')
for (let i = 0; i < tweets.length; i++) {
let likeButton = tweets[i].parentElement.parentElement.children[2]
let historyButton = likeButton.cloneNode(true)
historyButton.children[0].children[0].children[0].remove()
historyButton.children[0].children[0].children[0].children[0].children[0].innerHTML = 'History'
likeButton.after(historyButton)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment