DeepSeek Chat Tweaks - Turbo Edition

Force custom styles and replace placeholder on chat.deepseek.com instantly, and keep them forever—even when the site tries to revert.

目前为 2025-03-22 提交的版本。查看 最新版本

// ==UserScript==
// @name         DeepSeek Chat Tweaks - Turbo Edition
// @version      1.4
// @description  Force custom styles and replace placeholder on chat.deepseek.com instantly, and keep them forever—even when the site tries to revert.
// @match        https://chat.deepseek.com/*
// @grant        GM_addStyle
// @namespace https://gf.qytechs.cn/users/1449043
// ==/UserScript==

(function() {
    'use strict';

    // Function to force CSS Variables and placeholder text continuously
    function enforceStyles() {
        // Force CSS Variables
        const body = document.querySelector('body[data-ds-dark-theme]');
        if (body) {
            body.style.setProperty('--dsr-bg', '#212121', 'important');
        }

        // Change Placeholder Text
        const textarea = document.querySelector('textarea#chat-input._27c9245');
        if (textarea && textarea.placeholder !== "Ask anything") {
            textarea.placeholder = "Ask anything";
        }
    }

    // Inject permanent CSS styles
    GM_addStyle(`
        ._77cefa5 .dd442025 {
            background-color: #303030 !important;
        }
    `);
    GM_addStyle(`
        ._7436101 {
            background-color: rgb(255, 255, 255) !important;
            color: rgb(31, 31, 31) !important;
        }
    `);
    GM_addStyle(`
        :root {
            --dsr-side-bg: #171717 !important;
            scrollbar-color: #171717 transparent !important;
        }
    `);
    GM_addStyle(`
        [data-ds-dark-theme] .fbb737a4 {
            background-color: rgb(48, 48, 48) !important;
            border-radius: 36px !important;
            box-shadow: none !important;
            border: 1px solid #363636 !important;
        }
    `);

    // ** The newly requested style overrides **
    GM_addStyle(`
        .b8812f16,
        ._48cdfc1,
        ._83421f9 {
            background-color: #171717 !important;
        }
        ._48cdfc1 {
            color: white !important;
        }
    `);

    // Run immediately on page load
    enforceStyles();

    // Use MutationObserver to catch DOM changes
    const observer = new MutationObserver(enforceStyles);
    observer.observe(document.body, { childList: true, subtree: true, attributes: true, attributeFilter: ['style', 'placeholder'] });

    // Listen to window resize events to reapply styles instantly
    window.addEventListener('resize', enforceStyles);

    // Fallback: Check every 100ms to enforce styles without fail
    setInterval(enforceStyles, 100);
})();

QingJ © 2025

镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址