Lightweight X Plus

Performance tweaks with minimal UX impact

You will need to install an extension such as Tampermonkey, Greasemonkey or Violentmonkey to install this script.

You will need to install an extension such as Tampermonkey to install this script.

You will need to install an extension such as Tampermonkey or Violentmonkey to install this script.

You will need to install an extension such as Tampermonkey or Userscripts to install this script.

You will need to install an extension such as Tampermonkey to install this script.

You will need to install a user script manager extension to install this script.

(I already have a user script manager, let me install it!)

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

ستحتاج إلى تثبيت إضافة مثل Stylus لتثبيت هذا النمط.

ستحتاج إلى تثبيت إضافة لإدارة أنماط المستخدم لتتمكن من تثبيت هذا النمط.

ستحتاج إلى تثبيت إضافة لإدارة أنماط المستخدم لتثبيت هذا النمط.

ستحتاج إلى تثبيت إضافة لإدارة أنماط المستخدم لتثبيت هذا النمط.

(لدي بالفعل مثبت أنماط للمستخدم، دعني أقم بتثبيته!)

// ==UserScript==
// @name         Lightweight X Plus
// @namespace    lightweight-x-userscript
// @version      2.1
// @description  Performance tweaks with minimal UX impact
// @match        *://*.twitter.com/*
// @match        *://*.x.com/*
// @run-at       document-start
// @grant        none
// @license      GPLv3
// @author       Kdroidwin
// ==/UserScript==

(function () {
    'use strict';

    const style = document.createElement('style');
    style.textContent = `
        /* 1. ぼかし完全削除 */
        * {
            backdrop-filter: none !important;
        }

        /* 2. 透明レイヤー軽量化(濃度のみ調整) */
        header, nav, [role="dialog"] {
            background-color: rgba(0,0,0,0.85) !important;
        }

        /* 3. 重い影だけ削除(カード・モーダル系) */
        [role="dialog"],
        div[style*="box-shadow"],
        div[data-testid="card"] {
            box-shadow: none !important;
        }
    `;

    document.documentElement.appendChild(style);

    /* 4. 動画自動再生停止(手動再生は可能) */
    document.addEventListener("play", function (e) {
        const v = e.target;
        if (v.tagName === "VIDEO" && !v.paused) {
            v.pause();
        }
    }, true);

})();