Hide retweets on your Twitter home page

Hide retweets on your Twitter home page, only show tweets from the people you follow in chronological order from newest to oldest

このスクリプトの質問や評価の投稿はこちら通報はこちらへお寄せください。
// ==UserScript==
// @name         Hide retweets on your Twitter home page
// @namespace    https://twitter.com/home
// @version      001
// @description  Hide retweets on your Twitter home page, only show tweets from the people you follow in chronological order from newest to oldest
// @match        https://twitter.com/home
// @grant        none
// @copyright    Personal
// ==/UserScript==

(function() {
    'use strict';

    // Function to check and hide posts
    function checkAndHidePosts() {
        // Get all posts
        let posts = document.querySelectorAll('[data-testid="tweet"]');
        
        // Loop through each post
        for (let post of posts) {
            // Check if the post is a retweet
            if (post.querySelector('[aria-label="Retweeted"]')) {
                // If it's a retweet, hide the post
                post.style.display = 'none';
            }
        }
    }

    // Call the check and hide posts function every 2 seconds
    setInterval(checkAndHidePosts, 2000);
})();