Greasy Fork

Greasy Fork is available in English.

Wide Deepseek

Make Deepseek wide!

// ==UserScript==
// @name         Wide Deepseek
// @namespace    http://tampermonkey.net/
// @version      2025-05-12
// @description  Make Deepseek wide!
// @author       Kingron
// @run-at       document-start
// @match        *://chat.deepseek.com/*
// @icon         https://www.google.com/s2/favicons?sz=64&domain=deepseek.com
// @grant        GM_addStyle
// @license MIT
// ==/UserScript==

(function() {
    'use strict';

    console.log('Wide deepseek run');
    GM_addStyle(`
    :root, :host {
        --message-list-max-width: none !important;
    }

    * {
        max-width: none !important;
    }

    [class*="_871cbca"] {
        position: static !important;
    }
`);

    const removeSticky = () => {
        let parent = document.querySelector('textarea#chat-input')?.closest('div');
        while (parent) { // 向上查找第一个带 position:sticky 的父 div
            const style = getComputedStyle(parent);
            if (style.position === 'sticky') {
                parent.style.cssText += 'position:static !important';
                break;
            }
            parent = parent.parentElement;
        }
    };

    new MutationObserver(removeSticky).observe(document, {
        subtree: true,
        childList: true,
    });
})();