Skip to content

Instantly share code, notes, and snippets.

@chadlavi
Created April 22, 2023 21:13
Show Gist options
  • Save chadlavi/2fd3e8fc7383ecf55eebe04649e9e955 to your computer and use it in GitHub Desktop.
Save chadlavi/2fd3e8fc7383ecf55eebe04649e9e955 to your computer and use it in GitHub Desktop.
// get all the three-dot menus that are within tweets
document.querySelectorAll("article [aria-label=More]")
// for each three-dot menu...
.forEach(m => {
// click to open the menu
m.click();
// then find and click on the block item in the menu
document.querySelector("[role=menu] [data-testid=block]").click();
// then find and click on the confirmation button in the modal
document.querySelector("[role=button][data-testid=confirmationSheetConfirm]").click();
})
@chadlavi
Copy link
Author

chadlavi commented Apr 22, 2023

You can paste this into the console in dev tools to block the authors of all the tweets that are currently visible. Like say on a search results page on twitter, for example this one https://twitter.com/search?q=%22pay%20the%20%248%22%20filter%3Ablue_verified

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment