您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
increase chat gpt box width
当前为
// ==UserScript== // @name ChatGPT width // @namespace http://tampermonkey.net/ // @version 0.3 // @description increase chat gpt box width // @author bitmunja // @license MIT // @match https://chat.openai.com/chat/* // @icon data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw== // @grant none // ==/UserScript== (function() { 'use strict'; function delay(time) { return new Promise(resolve => setTimeout(resolve, time)); } // Convenience function to execute your callback only after an element matching readySelector has been added to the page. // Example: runWhenReady('.search-result', augmentSearchResults); // Gives up after 1 minute. function runWhenReady(readySelector, callback) { var numAttempts = 0; var tryNow = function() { var elem = document.querySelector(readySelector); if (elem) { callback(elem); } else { numAttempts++; if (numAttempts >= 34) { console.warn(`ChatGPT-width: giving up after 34 attempts. Could not find: ${readySelector}`); } else { setTimeout(tryNow, 250 * Math.pow(1.1, numAttempts)); } } }; tryNow(); } function applyElementWidth() { // console.debug(`ChatGPT-width: ready to process after content loaded...`); function doWork() { delay(5000); const elements = document.querySelectorAll('.text-base'); // console.debug(`ChatGPT-width: have ${elements.length} elements to process...`); for (let i = 0; i < elements.length; i++) { // console.debug(`ChatGPT-width: processing element: ${elements[i]}`); elements[i].style.setProperty('max-width', '98%', 'important'); } } doWork(); const observer = new MutationObserver(function(mutations) { let eventRegistrationCount = 0; mutations.forEach(function(mutation) { if (mutation.type === 'childList') { eventRegistrationCount++; } }); if(eventRegistrationCount > 0) { // console.debug('ChatGPT-width: mutation event, applying width adjustments...'); doWork(); } }); // console.debug('ChatGPT-width: ready to observe mutations...'); observer.observe(document.documentElement, { childList: true, subtree: true }); }; // dynamic page events runWhenReady('.text-base', applyElementWidth, false); })();