Skip to content

Instantly share code, notes, and snippets.

@karbassi
Last active July 15, 2021 03:12
Show Gist options
  • Save karbassi/0c1938aa9abf5790b7f8f7fbc14bfdd8 to your computer and use it in GitHub Desktop.
Save karbassi/0c1938aa9abf5790b7f8f7fbc14bfdd8 to your computer and use it in GitHub Desktop.
Tweetdeck Clear All - 2021
function clearAll() {
document.querySelectorAll('.js-column').forEach((column) => {
column.querySelector('a[data-action="options"]').click();
setTimeout(() => {
column.querySelector('[data-action="clear"]').click();
setTimeout(() => {
column.querySelector('a[data-action="options"]').click();
}, 150);
}, 200);
});
}
function addButton() {
let parent = document.createElement('div');
parent.innerHTML =
'<a class="link-clean cf app-nav-tab padding-h--10 padding-v--2" data-title="Clear All"> <div class="obj-left margin-l--2"> <i class="icon icon-clear-timeline icon-medium position-rel"></i> </div> <div class="nbfc padding-ts hide-condensed txt-size--14 txt-bold app-nav-tab-text">Clear All</div> </a>';
let button = parent.firstChild;
button.addEventListener('click', clearAll);
document.querySelector('.app-navigator').prepend(button);
}
addButton();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment