更宽的AI对话窗口↔️

使 ChatGPT/claude/Kimi/通义/智谱GLM/天工/deepseek 中 的AI对话窗口更宽。

目前为 2024-08-30 提交的版本。查看 最新版本

// ==UserScript==
// @name         Wider AI Chat↔️
// @name:zh-CN   更宽的AI对话窗口↔️
// @namespace    http://tampermonkey.net/
// @version      0.2.1
// @description  Make the AI chat dialog window wider for  ChatGPT/claude/Kimi/Tongyi/ChatGLM/Tiangong/deepseek 
// @description:zh-CN 使 ChatGPT/claude/Kimi/通义/智谱GLM/天工/deepseek 中 的AI对话窗口更宽。
// @author       You
// @match        http*://chatgpt.com/c/*
// @match        http*://chatgpt.com/*
// @match        http*://new.oaifree.com/*
// @match        https://shared.oaifree.com/*
// @match        http*://www.aicnn.cn/oaifree/*
// @match        http*://chat.aicnn.xyz/*
// @match        http*://plus.aivvm.com/*
// @match        http*://kimi.moonshot.cn/chat/*
// @match        http*://kimi.moonshot.cn/*
// @match        http*://tongyi.aliyun.com/qianwen*
// @match        http*://chatglm.cn/*
// @match        https://claude.ai/*
// @match        https://chat.deepseek.com/*
// @include      https://*claude*/*
// @match        https://chat.kelaode.ai/*
// @icon     data:image/svg+xml;base64,PHN2ZyB2aWV3Qm94PSIwIDAgMjQgMjQiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+CiAgPHJlY3Qgd2lkdGg9IjI0IiBoZWlnaHQ9IjI0IiByeD0iNSIgcnk9IjUiIGZpbGw9IiM2YmIiLz4KICA8cGF0aCBkPSJtMTcgMTMuNyA0LTQtNC00bS0xMCA4LTQtNCA0LTRtMTMuOTk5IDMuODI1SDMuMjE1Ii8+CiAgPHBhdGggZD0iTTE5IDE2aC0yLjVhLjk5LjkgMCAwIDAtLjc3NS4zNzVsLTIuOSAzLjY1Yy0uNC41LTEuMTYyLjUtMS41NjMgMGwtMi45MjUtMy42NUEuOTkuOSAwIDAgMCA3LjUgMTZINWMtMS42NjMgMC0zLTEuMzM4LTMtM1Y2YzAtMS42NjIgMS4zNS0zIDMtM2gxNGEzIDMgMCAwIDEgMyAzdjdjMCAxLjY2Mi0xLjM1IDMtMyAzWiIgZmlsbC1vcGFjaXR5PSIuMTYiIHN0cm9rZT0iI0VFRSIgc3Ryb2tlLXdpZHRoPSIxLjUiIHN0cm9rZS1taXRlcmxpbWl0PSIxMCIvPgo8L3N2Zz4K
// @license      AGPL-v3.0
// @author       Yearly
// @grant        GM_addStyle
// ==/UserScript==

(function() {

  if ( /kimi.moonshot.cn/.test(location.href) ) {
    console.log("kimi")
    GM_addStyle(`
    div[data-testid]  div[data-index]  div.MuiBox-root {
      max-width: 100% !important;
    }
    div[class^=mainContent] div.MuiBox-root > div[class^=chatBottom_]
     {
      max-width: calc(100% - 100px);
    }
    div[class^=mainContent] div[class^=chatInput_ ] div[class^=inputInner_]  div[class^=editor] {
      max-height: 360px;
    }
    #scroll-list div[class^=chatItemBox_].MuiBox-root {
      max-width: 100%;
    }

    `);
  } else if ( /chat.deepseek.com/.test(location.href) ) {
    console.log("deepseek")
    GM_addStyle(`
        div:has( > #latest-context-divider) {
          width: 95% !important;
        }
        div:has( > div > #chat-input) {
          width: 95% !important;
          max-width: 90vw;
        }
        `);
  } else if ( /tongyi.aliyun.com/.test(location.href) ) {
    console.log("tongyi")
    GM_addStyle(`
        div[class^=mainContent] div[class^=questionItem--] {
          width:90% !important;
          max-width: 90vw;
        }
        div[class^=mainContent] div[class^=answerItem--] {
          width:90% !important;
          max-width: 90vw;
        }
        `);
  } else if ( /www.tiangong.cn/.test(location.href) ) {
    console.log("tiangong")
    GM_addStyle(`
        label.w-full {
          max-width: 95%;
          --search-max-width: 95%;
        }
        :root {
          --search-max-width: 95%;
        }
        `);
  } else if (/chatglm.cn/.test(location.href)) {
    console.log("chatglm")
    GM_addStyle(`
        div.conversation-inner.dialogue >  div.conversation-list.detail > div.item.conversation-item {
          max-width: 95vw !important;
        }
        .markdown-body.md-body {
          max-width: 95vw !important;
        }
        `);
  } else {
    console.log("chatgpt/claude")
    GM_addStyle(`
        .xl\:max-w-\[48rem\] {
          width:95% !important;
          max-width:96% !important;
        }
        div.mx-auto.md:max-w-3xl {
          max-width: calc(100% - 10px);
        }
        div.mx-auto.flex {
          max-width: calc(100% - 10px);
        }
        pre > div.rounded-md > div.overflow-y-auto {
          max-height: 50vh;
          overflow: auto;
          scrollbar-width: thin;
          scrollbar-color: #aaaa #1111;
        }
        pre > div.rounded-md > div.overflow-y-auto ::-webkit-scrollbar-track {
          background: #1111;
        }
        pre > div.rounded-md > div.overflow-y-auto ::-webkit-scrollbar-thumb {
          background: #aaaa;
        }
        pre > div.rounded-md > div.overflow-y-auto ::-webkit-scrollbar-thumb:hover {
          background: #0008;
        }
        div.ProseMirror.break-words.ProseMirror-focused {
          max-width:100%;
        }
        .code-block__code {
          max-height: 50vh;
          overflow: auto;
          scrollbar-width: thin;
          scrollbar-color: #aaaa #1111;
        }
        body > div.flex.min-h-screen.w-full div.flex.flex-col div.flex.gap-2 div.mt-1.max-h-96.w-full.overflow-y-auto.break-words > div.ProseMirror.break-words{
          max-width:90%;
        }
        `);

    function link_addhref() {
      document.querySelectorAll('div[data-message-id] a[rel="noreferrer"]').forEach(function(item) {
        if(!item.href){
          item.href = item.innerText;
          item.target = "_blank"
        }
      });
      setTimeout(link_addhref, 1800);
    }
    link_addhref();

  }

})();