您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
Hides reposts (retweets) when scrolling
- // ==UserScript==
- // @name Hide Reposts on Twitter
- // @description Hides reposts (retweets) when scrolling
- // @namespace Hide_Reposts_on_Twitter
- // @compatible Chrome
- // @compatible Firefox
- // @version 1.21
- // @author Owyn
- // @match https://x.com/*
- // @match https://twitter.com/*
- // @grant GM_registerMenuCommand
- // @noframes
- // @run-at document-end
- // @sandbox JavaScript
- // @license MIT
- // ==/UserScript==
- 'use strict';
- const tweetCSS = '[data-testid="cellInnerDiv"]';
- const repostCSS = '[data-testid="socialContext"]';
- const alreadyHiddenCSS = '[style*="display: none;"]';
- function hideReposts()
- {
- var n = document.querySelectorAll(tweetCSS+':has('+repostCSS+'):not('+alreadyHiddenCSS+')');
- for (let i = 0; i < n.length; i++)
- {
- n[i].style.display = "none";
- console.debug("hid a repost");
- }
- setTimeout(hideReposts, 500);
- }
- window.addEventListener("scroll", hideReposts);
- if (typeof GM_registerMenuCommand !== "undefined")
- {
- GM_registerMenuCommand("Disable (this once for this page)", () => window.removeEventListener("scroll", hideReposts), "h");
- }
QingJ © 2025
镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址