Created
December 16, 2025 06:26
-
-
Save Taremin/22b5101f2e9749239e28a80a6a35cd6e to your computer and use it in GitHub Desktop.
Twitterで素早くフォロー中に切り替えるUserScript
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 Twitter | |
| // @namespace http://tampermonkey.net/ | |
| // @version 2025-12-16 | |
| // @description ページ読み込み後「フォロー中」をクリックする | |
| // @author Taremin | |
| // @match https://x.com/home | |
| // @grant none | |
| // ==/UserScript== | |
| (function() { | |
| 'use strict'; | |
| const observer = new MutationObserver((mutationList, observer) => { | |
| for (const mutation of mutationList) { | |
| if (mutation.type === "childList") { | |
| const targets = Array.prototype.concat(mutation.addedNodes, [mutation.target]) | |
| for (const target of targets) { | |
| const tabs = document.querySelectorAll('[role="tab"]'); | |
| for (const tab of tabs) { | |
| if (/フォロー中/.test(tab.innerHTML)) { | |
| tab.click(); | |
| observer.disconnect(); | |
| } | |
| } | |
| } | |
| } | |
| } | |
| }); | |
| observer.observe(document.body, { attributes: false, childList: true, subtree: true }); | |
| })(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment