更宽的AI对话窗口↔️

使 ChatGPT/Claude/Kimi/通义/智谱GLM/天工/Deepseek/Gemini/腾讯元宝/grok 中 的AI对话窗口更宽。

  1. // ==UserScript==
  2. // @name Wider AI Chat↔️
  3. // @name:zh-CN 更宽的AI对话窗口↔️
  4. // @namespace http://tampermonkey.net/
  5. // @version 0.3.0
  6. // @description Make the AI chat dialog window wider for ChatGPT/Claude/Kimi/Tongyi/ChatGLM/Tiangong/Deepseek/Gemini/Tencent Yuanbao/grok
  7. // @description:zh-CN 使 ChatGPT/Claude/Kimi/通义/智谱GLM/天工/Deepseek/Gemini/腾讯元宝/grok 中 的AI对话窗口更宽。
  8. // @author You
  9. // @match http*://chatgpt.com/c/*
  10. // @match http*://chatgpt.com/*
  11. // @match http*://new.oaifree.com/*
  12. // @match https://shared.oaifree.com/*
  13. // @match http*://www.aicnn.cn/oaifree/*
  14. // @match http*://chat.aicnn.xyz/*
  15. // @match http*://plus.aivvm.com/*
  16. // @match http*://kimi.moonshot.cn/chat/*
  17. // @match http*://kimi.moonshot.cn/*
  18. // @match http*://tongyi.aliyun.com/qianwen*
  19. // @match https://www.tiangong.cn/*
  20. // @match http*://chatglm.cn/*
  21. // @match https://claude.ai/*
  22. // @match https://chat.deepseek.com/*
  23. // @include https://*claude*/*
  24. // @match https://chat.kelaode.ai/*
  25. // @match https://gemini.google.com/*
  26. // @match https://grok.com/*
  27. // @match https://yuanbao.tencent.com/*
  28. // @icon data:image/svg+xml;base64,PHN2ZyB2aWV3Qm94PSIwIDAgMjQgMjQiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+CiAgPHJlY3Qgd2lkdGg9IjI0IiBoZWlnaHQ9IjI0IiByeD0iNSIgcnk9IjUiIGZpbGw9IiM2YmIiLz4KICA8cGF0aCBkPSJtMTcgMTMuNyA0LTQtNC00bS0xMCA4LTQtNCA0LTRtMTMuOTk5IDMuODI1SDMuMjE1Ii8+CiAgPHBhdGggZD0iTTE5IDE2aC0yLjVhLjk5LjkgMCAwIDAtLjc3NS4zNzVsLTIuOSAzLjY1Yy0uNC41LTEuMTYyLjUtMS41NjMgMGwtMi45MjUtMy42NUEuOTkuOSAwIDAgMCA3LjUgMTZINWMtMS42NjMgMC0zLTEuMzM4LTMtM1Y2YzAtMS42NjIgMS4zNS0zIDMtM2gxNGEzIDMgMCAwIDEgMyAzdjdjMCAxLjY2Mi0xLjM1IDMtMyAzWiIgZmlsbC1vcGFjaXR5PSIuMTYiIHN0cm9rZT0iI0VFRSIgc3Ryb2tlLXdpZHRoPSIxLjUiIHN0cm9rZS1taXRlcmxpbWl0PSIxMCIvPgo8L3N2Zz4K
  29. // @license AGPL-v3.0
  30. // @author Yearly
  31. // @grant GM_addStyle
  32. // @noframes
  33. // ==/UserScript==
  34.  
  35. (function() {
  36.  
  37. var limit_anser_height = false;
  38.  
  39. if ( /kimi.moonshot.cn/.test(location.href) ) {
  40. console.log("kimi");
  41. GM_addStyle(`
  42. div[data-testid] div[data-index] div.MuiBox-root {
  43. max-width: 100% !important;
  44. }
  45. #app div.chat-editor {
  46. max-width: calc(100% - 50px);
  47. }
  48.  
  49. div[class^=mainContent] div.MuiBox-root > div[class^=chatBottom_]
  50. {
  51. max-width: calc(100% - 50px);
  52. }
  53. div.chat-detail-main div.chat-content-container > div.chat-content-list {
  54. max-width: calc(100% - 50px);
  55. }
  56. div.history-modal-container div.history-modal-list {
  57. max-width: 90%;
  58. }
  59.  
  60. #scroll-list div[class^=chatItemBox_].MuiBox-root {
  61. max-width: 100%;
  62. }
  63. #root > div > div[class*=mainContent] > div[class*=layoutContent] > div.MuiBox-root > div.MuiBox-root[class*=homepage] > div.MuiContainer-root.MuiContainer-maxWidthMd {
  64. max-width: calc(100% - 100px);
  65. }
  66. div.MuiBox-root[class^=homepage] div[class^=mainContent] div[class^=chatInput_ ] div[class^=inputInner_] div[class^=editor] {
  67. max-height: 600px;
  68. }
  69. `);
  70.  
  71. if (limit_anser_height) {
  72. GM_addStyle(`
  73. div[class^=mainContent] div[class^=chatInput_ ] div[class^=inputInner_] div[class^=editor] { max-height: 400px; }
  74. `);
  75. }
  76. } else if ( /chat.deepseek.com/.test(location.href) ) {
  77. console.log("deepseek");
  78. GM_addStyle(`
  79. div:has( > #latest-context-divider) {
  80. width: 95% !important;
  81. }
  82. div:has( > div > #chat-input) {
  83. width: 95% !important;
  84. max-width: 90vw;
  85. }
  86. :root {
  87. --message-list-max-width: calc(100% - 20px);
  88. }
  89. #root > div > div.d4850e57 > div.d7ae46fd > div.ad902ce3 {
  90. max-width: calc(100% - 20px);
  91. }
  92. #root > div > div.c3ecdb44 > div.f2eea526 > div > div > div.a2f8e4bb {
  93. max-width: calc(100% - 20px);
  94. }
  95.  
  96. #root > div > div.c3ecdb44 > div.f2eea526 > div > div > div.a2f8e4bb > div.aaff8b8f.eb830e32 > div > div > div.fad49dec {
  97. max-height: 50vh;
  98. }
  99. `);
  100.  
  101. if (limit_anser_height) {
  102. GM_addStyle(`
  103. #root > div > div > div:nth-child(2) > div > div > div > div > div > div {
  104. max-height: 600px;
  105. overflow-y: auto;
  106. }`);
  107. }
  108. } else if ( /tongyi.aliyun.com/.test(location.href) ) {
  109. console.log("tongyi");
  110. GM_addStyle(`
  111. div[class^=mainContent] div[class^=questionItem--] {
  112. width:90% !important;
  113. max-width: 90vw;
  114. }
  115. div[class^=mainContent] div[class^=answerItem--] {
  116. width:90% !important;
  117. max-width: 90vw;
  118. }
  119. div[class^=mainContent] div[class^=inputOutWrap--] {
  120. width:90% !important;
  121. max-width: 90vw;
  122. }
  123. `);
  124. } else if ( /www.tiangong.cn/.test(location.href) ) {
  125. console.log("tiangong");
  126. GM_addStyle(`
  127. #app > div > div > main > div.overflow-y-scroll.w-full > div.search-content.relative.flex.w-full.flex-row.justify-center {
  128. max-width: calc(100% - 100px);
  129. --search-max-width: calc(100% - 100px);
  130. }
  131. #app > div > div > main > div.overflow-y-scroll.w-full > div.search-content.relative.flex.w-full.flex-row.justify-center > label.w-full.cursor-default.select-auto {
  132. max-width: calc(100% - 100px);
  133. --search-max-width: calc(100% - 100px);
  134. }
  135. label.w-full {
  136. max-width: calc(100% - 100px);
  137. --search-max-width: calc(100% - 100px);
  138. }
  139. :root {
  140. --search-max-width: calc(100% - 100px);
  141. }`);
  142. } else if (/chatglm.cn/.test(location.href)) {
  143. console.log("chatglm");
  144. GM_addStyle(`
  145. div.conversation-inner.dialogue > div.conversation-list.detail > div.item.conversation-item {
  146. max-width: 95vw !important;
  147. }
  148. .markdown-body.md-body {
  149. max-width: 95vw !important;
  150. }
  151. `);
  152. } else if (/gemini.google.com/.test(location.href)) {
  153. console.log("gemini");
  154. GM_addStyle(`
  155. #chat-history > infinite-scroller > div {
  156. max-width: calc(100% - 20px);
  157. }
  158. #app-root > main > side-navigation-v2 > bard-sidenav-container > bard-sidenav-content > div > div > div.content-container > chat-window > div.chat-container.ng-star-inserted > div.bottom-container.response-optimization.ng-star-inserted {
  159. max-width: calc(100% - 20px);
  160. }
  161. #app-root > main > side-navigation-v2 > bard-sidenav-container > bard-sidenav-content > div > div > div.content-container > chat-window > div.chat-container.ng-star-inserted > div.bottom-container.response-optimization.ng-star-inserted > div.input-area-container.ng-star-inserted {
  162. max-width: calc(100% - 20px);
  163. }`);
  164.  
  165. } else if (/grok.com/.test(location.href)) {
  166. console.log("grok.com");
  167. GM_addStyle(`
  168. main div.relative.w-full.flex.flex-col.items-center > div.w-full.max-w-3xl.flex.flex-col {
  169. max-width: calc(100% - 20px);
  170. }
  171. main div.flex.flex-col.items-center > div.flex.flex-col-reverse.items-center > form.bottom-0.w-full.items-center.justify-center > div.justify-center.w-full {
  172. max-width: calc(100% - 20px);
  173. }
  174. .max-w-3xl {
  175. width:95% !important;
  176. max-width:96% !important;
  177. }
  178. div.absolute.mx-auto.z-50 {
  179. max-width: calc(100% - 50px);
  180. }
  181. div.absolute.mx-auto.z-50 .duration-100.relative.w-full {
  182. max-width: calc(100% - 50px);
  183. }
  184. `);
  185.  
  186. } else if (/yuanbao.tencent.com/.test(location.href)) {
  187. console.log("yuanbao");
  188. GM_addStyle(`
  189. :root {
  190. --hunyuan-chat-list-max-width: calc(100% - 40px);
  191. }`);
  192. } else {
  193. console.log("chatgpt/claude");
  194.  
  195. const chatWiderStyle = `
  196. .xl\:max-w-\[48rem\] {
  197. width:95% !important;
  198. max-width:96% !important;
  199. }
  200. div.mx-auto.md:max-w-3xl {
  201. max-width: calc(100% - 10px);
  202. }
  203. div.mx-auto.flex {
  204. max-width: calc(100% - 10px);
  205. }
  206. div.ProseMirror.break-words.ProseMirror-focused {
  207. max-width:100%;
  208. }
  209. 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{
  210. max-width:90%;
  211. }
  212.  
  213. body > div.flex.min-h-screen.w-full > div > main > div.top-5.z-10.mx-auto.w-full.max-w-2xl.md{
  214. max-width:100%;
  215. }
  216.  
  217. body > div.flex.min-h-screen.w-full > div > main > div.mx-auto.w-full.max-w-2xl.px-1.md {
  218. max-width:100%;
  219. }
  220. body > div.flex.min-h-screen.w-full > div > main.max-w-7xl {
  221. max-width: 90rem;
  222. }
  223. main > div.composer-parent article > div.text-base > div.mx-auto {
  224. max-width: 95%;
  225. }
  226. main article > div.text-base > div.mx-auto {
  227. max-width: 95%;
  228. } `;
  229.  
  230. if (limit_anser_height) {
  231. GM_addStyle(`
  232. pre > div.rounded-md > div.overflow-y-auto {
  233. max-height: 50vh;
  234. overflow: auto;
  235. scrollbar-width: thin;
  236. scrollbar-color: #aaaa #1111;
  237. }
  238. .code-block__code {
  239. max-height: 50vh;
  240. overflow: auto;
  241. scrollbar-width: thin;
  242. scrollbar-color: #aaaa #1111;
  243. }
  244. pre > div.rounded-md > div.overflow-y-auto ::-webkit-scrollbar-track {
  245. background: #1111;
  246. }
  247. pre > div.rounded-md > div.overflow-y-auto ::-webkit-scrollbar-thumb {
  248. background: #aaaa;
  249. }
  250. pre > div.rounded-md > div.overflow-y-auto ::-webkit-scrollbar-thumb:hover {
  251. background: #0008;
  252. }
  253. `);
  254. }
  255.  
  256. GM_addStyle(chatWiderStyle);
  257.  
  258. enhanceAddStyle();
  259.  
  260. function enhanceAddStyle(setStyle) {
  261. const chat = document.querySelector("main > div.composer-parent article > div.text-base > div.mx-auto");
  262. if (chat) {
  263. if( window.getComputedStyle(chat).maxWidth != '95%') {
  264. GM_addStyle(chatWiderStyle);
  265. }
  266. } else {
  267. setTimeout(enhanceAddStyle, 1100);
  268. }
  269. }
  270.  
  271. function link_addhref() {
  272. document.querySelectorAll('div[data-message-id] a[rel="noreferrer"]').forEach(function(item) {
  273. if(!item.href){
  274. item.href = item.innerText;
  275. item.target = "_blank"
  276. }
  277. });
  278. setTimeout(link_addhref, 1800);
  279. }
  280. link_addhref();
  281.  
  282. }
  283.  
  284. })();
  285.  
  286. +
  287. 66
  288.  

QingJ © 2025

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