Greasy Fork

Greasy Fork is available in English.

Deepseek Chat Width Wizard (style)

Designed to optimize the width of the chat window, you can enjoy the best chat experience at any screen size. This plugin provides a more intuitive and comfortable chat interface by automatically adjusting and customizing element widths.|界面优化

当前为 2025-02-20 提交的版本,查看 最新版本

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

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

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

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

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

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

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

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

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

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

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

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

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

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

// ==UserScript==
// @name         Deepseek Chat Width Wizard (style)
// @namespace    http://tampermonkey.net/
// @version      1.0
// @description  Designed to optimize the width of the chat window, you can enjoy the best chat experience at any screen size. This plugin provides a more intuitive and comfortable chat interface by automatically adjusting and customizing element widths.|界面优化
// @author       Bela Proinsias
// @match        https://chat.deepseek.com/a/chat/*
// @match        https://chat.deepseek.com
// @icon         https://www.google.com/s2/favicons?sz=64&domain=deepseek.com
// @grant        none
// @license      MIT
// ==/UserScript==

(function () {
  "use strict";

  const TARGET_VARIABLE = "--message-list-max-width";

  function setCustomWidth() {
    const dynamicWidth = window.innerWidth * 0.85;
    const FINAL_WIDTH = `${dynamicWidth}px`;

    document.documentElement.style.setProperty(
      TARGET_VARIABLE,
      FINAL_WIDTH,
      "important"
    );

    document.querySelectorAll("*").forEach((el) => {
      if (getComputedStyle(el).getPropertyValue(TARGET_VARIABLE)) {
        el.style.setProperty(TARGET_VARIABLE, FINAL_WIDTH, "important");
      }
    });
  }

  function observeChanges() {
    new MutationObserver(setCustomWidth).observe(document.body, {
      childList: true,
      subtree: true,
      attributes: true,
    });
  }

  window.addEventListener("load", () => {
    setCustomWidth();
    observeChanges();
  });

  window.addEventListener("resize", setCustomWidth);
})();