Hide replies in your X.com (Twitter) home timeline.
当前为
// ==UserScript==
// @name Hide Replies from Timeline on X.com
// @namespace http://tampermonkey.net/
// @version 1.0
// @description Hide replies in your X.com (Twitter) home timeline.
// @author
// @match https://x.com/*
// @grant none
// @license MIT
// ==/UserScript==
(function() {
'use strict';
/**
* Function to hide reply tweets from the home timeline.
*/
function hideReplies() {
// Select all tweets in the timeline
const tweets = document.querySelectorAll('div[data-testid="cellInnerDiv"]');
tweets.forEach((tweet) => {
// Check if the tweet is a reply
const replyBadge = tweet.querySelector('div[aria-label="Replying to"]');
if (replyBadge) {
// Hide the tweet if it's a reply
tweet.style.display = 'none';
}
});
}
// Run the function once the DOM content is loaded
document.addEventListener('DOMContentLoaded', hideReplies);
// Observe changes to the timeline to hide new replies
const observer = new MutationObserver(hideReplies);
observer.observe(document.body, { childList: true, subtree: true });
})();
QingJ © 2025
镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址