Last active
April 13, 2025 22:27
-
-
Save aiya000/9c5a16c3a96f0b14576923128fe261b4 to your computer and use it in GitHub Desktop.
Deprecated. ~~A tampermonky script, to solves the problem of the 'Control Panel for Twitter' extension not being able to hide the number of followers of a Twitter account.~~
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 Follower Count | |
// @namespace https://gist.github.com/aiya000/9c5a16c3a96f0b14576923128fe261b4 | |
// @version 2025-04-09 | |
// @description Remove Twitter(X)'s follower count at profile. This solves the problem of the 'Control Panel for Twitter' extension not being able to hide the number of followers of a Twitter account. | |
// @author aiya000 | |
// @match https://x.com/* | |
// @match https://twitter.com/* | |
// @icon data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw== | |
// @grant none | |
// ==/UserScript== | |
;(function () { | |
'use strict' | |
// Monitor dynamically generated elements | |
new MutationObserver(() => { | |
document.querySelectorAll('a').forEach((link) => { | |
const combinedText = Array.from(link.querySelectorAll('span')) | |
.map((span) => span.textContent.trim()) | |
.join('') | |
// NOTE: Below outputs like '4,1384,138フォロワーフォロワー', but '4,138フォロワー' is not shown. What? | |
// console.log('poi:', combinedText) | |
// NOTE: Below didn't work | |
// const pattern = /^\d{1,3}(,\d{3})*フォロワー$/ | |
const pattern = /\d{1,3}(,\d{3})*フォロワー/ // Currently, Japanese support only | |
if (pattern.test(combinedText)) { | |
link.style.display = 'none' | |
} | |
}) | |
}).observe(document.body, { childList: true, subtree: true }) | |
})() |
Use this.
やあ!これらのメトリックやその他のメトリックは次のように非表示にできます
— Control Panel for (@ControlPanelFT) April 10, 2025
TwitterのDOMはReact Native for Webを使用しているため非常に奇妙です pic.twitter.com/GOhryxQJb9
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
You should also install Control Panel for Twitter to clean noizes.