Skip to content

Instantly share code, notes, and snippets.

@takehaya
Created February 9, 2023 01:08
Show Gist options
  • Save takehaya/95f14bac455ab7674176bef3eb71cc56 to your computer and use it in GitHub Desktop.
Save takehaya/95f14bac455ab7674176bef3eb71cc56 to your computer and use it in GitHub Desktop.
// ==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