Greasy Fork is available in English.

Hide Reposts on Twitter

Hides reposts (retweets) when scrolling

2024-06-17 기준 버전입니다. 최신 버전을 확인하세요.

이 스크립트를 설치하려면 Tampermonkey, Greasemonkey 또는 Violentmonkey와 같은 확장 프로그램이 필요합니다.

이 스크립트를 설치하려면 Tampermonkey 또는 Violentmonkey와 같은 확장 프로그램이 필요합니다.

이 스크립트를 설치하려면 Tampermonkey 또는 Violentmonkey와 같은 확장 프로그램이 필요합니다.

이 스크립트를 설치하려면 Tampermonkey 또는 Userscripts와 같은 확장 프로그램이 필요합니다.

이 스크립트를 설치하려면 Tampermonkey와 같은 확장 프로그램이 필요합니다.

이 스크립트를 설치하려면 유저 스크립트 관리자 확장 프로그램이 필요합니다.

(이미 유저 스크립트 관리자가 설치되어 있습니다. 설치를 진행합니다!)

이 스타일을 설치하려면 Stylus와 같은 확장 프로그램이 필요합니다.

이 스타일을 설치하려면 Stylus와 같은 확장 프로그램이 필요합니다.

이 스타일을 설치하려면 Stylus와 같은 확장 프로그램이 필요합니다.

이 스타일을 설치하려면 유저 스타일 관리자 확장 프로그램이 필요합니다.

이 스타일을 설치하려면 유저 스타일 관리자 확장 프로그램이 필요합니다.

이 스타일을 설치하려면 유저 스타일 관리자 확장 프로그램이 필요합니다.

(이미 유저 스타일 관리자가 설치되어 있습니다. 설치를 진행합니다!)

// ==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");
}