// ==UserScript== // @name Claude Content Max-Width // @namespace http://tampermonkey.net/ // @version 0.1 // @description adjust Claude Content Max-Width // @author shawn-wxn // @match https://claude.ai/* // @match https://poe.com/* // @icon https://www.google.com/s2/favicons?sz=64&domain=claude.ai // @grant none // @license GPL-2.0-only // @downloadURL none // ==/UserScript== (function() { // 获取当前的 URL var currentURL = window.location.href; // 根据当前 URL 进行 if-else 逻辑判断 if (currentURL.includes("poe.com")) { var mainSectionDiv = document.querySelector("div[class*='PageWithSidebarLayout_mainSection']"); var classNames = mainSectionDiv.classList; var mainSectionDivClass = null; for (var i = 0; i < classNames.length; i++) { var className = classNames[i]; if (className.indexOf('PageWithSidebarLayout_mainSection') !== -1) { mainSectionDivClass = className; break; } } if (!mainSectionDivClass) { throw new Error("not found mainSectionDivClass"); } var botMessageBubble = document.querySelector("div[class*='Message_botMessageBubble']"); var classNames1 = botMessageBubble.classList; var botMessageBubbleClass = null; for (var i = 0; i < classNames1.length; i++) { var className = classNames1[i]; if (className.indexOf('Message_botMessageBubble') !== -1) { botMessageBubbleClass = className; break; } } if (!botMessageBubbleClass) { throw new Error("not found botMessageBubbleClass"); } var humanMessageBubble = document.querySelector("div[class*='Message_humanMessageBubble']"); var classNames2 = humanMessageBubble.classList; var humanMessageBubbleClass = null; for (var i = 0; i < classNames2.length; i++) { var className = classNames2[i]; if (className.indexOf('Message_humanMessageBubble') !== -1) { humanMessageBubbleClass = className; break; } } if (!humanMessageBubbleClass) { throw new Error("not found humanMessageBubbleClass"); } var styleTag = document.createElement('style'); // 将 CSS 样式添加到