Created
February 9, 2023 01:08
-
-
Save takehaya/95f14bac455ab7674176bef3eb71cc56 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ==UserScript== | |
// @name Remove Twitter Deck Card | |
// @namespace https://twitter.com/takemioIO | |
// @version 0.0.1 | |
// @description Remove the twitter views link from people's tweets | |
// @author takemioIO | |
// @match https://tweetdeck.twitter.com/* | |
// @icon https://static.thenounproject.com/png/1159224-200.png | |
// @license MIT | |
// ==/UserScript== | |
(function () { | |
"use strict"; | |
const removeViews = () => { | |
// Remove link version of view count | |
Array.from(document.querySelectorAll('div[data-testid="card.wrapper"]')) | |
.forEach(({ parentElement }) => parentElement.remove()); | |
}; | |
new MutationObserver((mutations) => { | |
mutations.forEach(({ addedNodes }) => !!addedNodes.length && removeViews()); | |
}).observe(document.body, { childList: true, subtree: true }); | |
removeViews(); | |
})(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment