Twitter fixes

Display whole images, display whole tweets, and various enhancements here and there

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Greasemonkey 油猴子Violentmonkey 暴力猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Violentmonkey 暴力猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Userscripts ,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展后才能安装此脚本。

(我已经安装了用户脚本管理器,让我安装!)

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

(我已经安装了用户样式管理器,让我安装!)

/* ==UserStyle==
@name           Twitter fixes
@namespace      zezombye.dev
@version        1.0.3
@description    Display whole images, display whole tweets, and various enhancements here and there
@author         Zezombye
@license        MIT
==/UserStyle== */

@-moz-document domain("x.com") {
    
    /*Display the whole images*/
    
    .r-4gszlv {
        background-size: contain;
    }
    
    /* Remove image border radius */
    
    article[data-testid="tweet"] > div:nth-child(1) > div:nth-child(1) > div:nth-child(2) > div:nth-child(2) > div:nth-child(3) > div:nth-child(1) > div:nth-child(1) > div:nth-child(1) > div:nth-child(1) {
        border-radius: 0;
    }
    article[data-testid="tweet"] > div:nth-child(1) > div:nth-child(1) > div:nth-child(3) > div:nth-child(2) > div:nth-child(1) > div:nth-child(1) > div:nth-child(1) > div:nth-child(1) > div:nth-child(1) {
        border-radius: 0;
    }
    
    /* Remove image useless padding on tweets with 2+ images */
    
    /*article[data-testid="tweet"] > div:nth-child(1) > div:nth-child(1) > div:nth-child(3) > div:nth-child(2) > div:nth-child(1) > div:nth-child(1) > div:nth-child(1) > div:nth-child(1) > div:nth-child(1) div[data-testid="tweetPhoto"] > img,
    article[data-testid="tweet"] > div:nth-child(1) > div:nth-child(1) > div:nth-child(3) > div:nth-child(2) > div:nth-child(1) > div:nth-child(1) > div:nth-child(1) > div:nth-child(1) > div:nth-child(1) div[data-testid="tweetPhoto"] > div {
        position: relative;
    }
    
    article[data-testid="tweet"] div[style="padding-bottom: 56.25%;"] {
        padding-bottom: 0 !important;
    }
    article[data-testid="tweet"] div[style="padding-bottom: 56.25%;"] + div,
    article[data-testid="tweet"] div[style="padding-bottom: 56.25%;"] + div a,
    article[data-testid="tweet"] div[style="padding-bottom: 56.25%;"] + div div {
        position: relative;
    }*/
    
    /* Remove quote tweet border radius */
    
    article[data-testid="tweet"] > div:nth-child(1) > div:nth-child(1) > div > div:nth-child(2) > div > div > div[tabindex="0"][role="link"] {
        border-radius: 0;
    }
    
    /* Hide "subscribe to premium"*/
    
    div[aria-label="Trending"] div:has(> aside[aria-label="Subscribe to Premium"]),
    div[aria-label="Trending"] div:has(> div > div[data-testid="super-upsell-UpsellCardRenderProperties"]),
    div[aria-label="Trending"] div:has(> div > div[data-testid="super-upsell-UpsellButtonRenderProperties"]) {
        display: none;
    }
    div[aria-label="Trending"] div:has(> div > aside[aria-label="Subscribe to Premium to write your own longer posts"]) {
        display: none;
    }
    
    /* Hide "who to follow" */
        
    div[aria-label="Trending"] div:has(> div > aside[aria-label="Who to follow"]) {
        display: none;
    }
    
    /* Hide "suggested videos" */
    
    div[aria-label="Trending"] div:has(> div > div > div > div[data-testid^="suggested-video-card-"]) {
        display: none;
    }
    
    /* Hide trending tab */
    
    div[aria-label="Trending"] div:has(> section > div[aria-label="Timeline: Trending now"]) {
        display: none;
    }
    div[aria-label="Trending"] div:has(> div > div > div[aria-label="Loading timeline"]) {
        display: none;
    }
    
    /* Hide "today's news" tab */
    
    div[aria-label="Trending"] div:has(> div[data-testid="news_sidebar"]) {
        display: none;
    }
    
    /* Hide tos, privacy policy, etc */
    
    div[aria-label="Trending"] div:has(> nav[aria-label="Footer"]) {
        display: none;
    }
    
    /* Hide "new tweets" thing */
    
    div[aria-label="New posts are available. Push the period key to go to the them."] {
        display: none;
    }
    
    /* Hide "unread items" home icon */
    
    nav[role="navigation"] > a[data-testid="AppTabBar_Home_Link"] div[aria-label="undefined unread items"] {
        display: none;
    }
    
    /* Remove line clamp on long tweets */
    
    div[data-testid="tweetText"] {
        -webkit-line-clamp: unset !important;
    }
    
    /* Remove "show more" link */
    
    /*div[data-testid="tweet-text-show-more-link"], a[data-testid="tweet-text-show-more-link"], button[data-testid="tweet-text-show-more-link"]  {
        display: none;
    }*/
    
    /* Unstick "for you/following" */
    
    div[aria-label="Home timeline"] > div:nth-child(1) {
        position: unset;
    }
    
    /* Remove post prompt on home timeline */
    
    div[aria-label="Home timeline"] > div:nth-child(3):has(> div > div[role="progressbar"]) {
        display: none;
    }
    
    /* Remove "push notifications" prompt */
    
    div[aria-label="Timeline: Your Home Timeline"] > div > div:has(>div > div > div > div[data-testid="inlinePrompt"] > div[data-testid="inlinePrompt-primaryAction"]) {
        display: none;
    }
    
    /* Remove "verified accounts can reply" */
    
    div:has(> div[aria-live="polite"][role="status"] > div > div > a[href="/i/premium_sign_up"]) {
        display: none;
    }
    
    /* Remove jobs on profile */
    
    div[data-testid="jobs"] {
        display: none;
    }
    
    /* Remove useless stuff on profile */
    
    button[aria-label="Send a tip"] {
        display: none;
    }
    
    button[aria-label^="Subscribe to @"] {
        display: none;
    }
    
    /* Remove useless stuff from the sidebar */
    
    nav[aria-label="Primary"] > a[data-testid="AppTabBar_Explore_Link"] {
        display: none;
    }
    nav[aria-label="Primary"] > a[data-testid="AppTabBar_Follow_Link"] {
        display: none;
    }
    nav[aria-label="Primary"] > a[data-testid="jobs-tab-item"] {
        display: none;
    }
    nav[aria-label="Primary"] > a[data-testid="premium-business-signup-tab"] {
        display: none;
    }
    nav[aria-label="Primary"] > a[data-testid="premium-signup-tab"] {
        display: none;
    }
    nav[aria-label="Primary"] > a[data-testid="vo-signup-tab"] {
        display: none;
    }
    nav[aria-label="Primary"] > a[aria-label="Creator Studio"] {
        display: none;
    }
    
    
    /* Remove grok suggestions on tweets */
    
    article[data-testid="tweet"] div:has(> nav[role="navigation"] > div > div[data-testid="ScrollSnap-SwipeableList"]) {
        display: none;
    }
    
    /* Remove grok buttons */
    
    /*article[data-testid="tweet"] button[aria-label="Grok actions"] {
        display: none;
    }*/
    
    /*div[data-testid="GrokDrawer"] {
        display: none;
    }*/
    
    div:has(> div[data-testid="grok_post_atgrok_button"]) {
        display: none;
    }
    
    /* Remove annoying glow on grok + msg drawer */
    
    div[data-testid="GrokDrawer"] > div, button[data-testid="chat-drawer-main"], button[data-testid="GrokDrawerHeader"] {
        box-shadow: none;
    }
    div[data-testid="GrokDrawer"] > div, div[data-testid="chat-drawer-main"] > div {
        border: 1px solid hsl(214 4% 31%);
    }
    
    /* Remove "Discover more" */
    
    div[aria-label="Timeline: Conversation"] > div > div:has(> div > div > div > h2[role="heading"]):has(> div > div > div > div > span) {
        display: none;
        & ~ div {
            display: none;
        }
    }
    
    
    /* ----- Mobile stuff ----- */
    
    /* Unstick navbar */
    div#layers div:has(div[data-testid="TopNavBar"]):has([data-testid="DashButton_ProfileIcon_Link"]) {
        position: relative;
    }
    /* Stick navbar when it has the back button (eg when viewing a post)*/
    div[data-testid="TopNavBar"] {
        
        transform: none !important;
        backdrop-filter: none;
        background-color: black;
        &:has([data-testid="app-bar-back"]) {
            border-bottom: 1px solid rgb(47, 51, 54);
        }
    }
    /* Remove the "new posts" blue bubble */
    div[data-testid="TopNavBar"] ~ div {
        display: none;
    }
    
        
    
    
}