您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
Adds a character counter to the input field with a limit of 32732 characters. (ChatGPT has a limit of 32732 characters.)
当前为
// ==UserScript== // @name ChatGPT Character Counter Limit (CCCL) // @namespace http://tampermonkey.net/ // @version 1.3 // @description Adds a character counter to the input field with a limit of 32732 characters. (ChatGPT has a limit of 32732 characters.) // @author Emree.el on instagram // @match https://chatgpt.com/* // @grant none // @license MIT // ==/UserScript== (function() { 'use strict'; // Function to add character counter and handle its behavior function addCharacterCounter() { let textarea = document.querySelector('#prompt-textarea'); if (textarea) { let charCounter = document.createElement('div'); charCounter.style.fontSize = '14px'; charCounter.style.fontWeight = 'bold'; charCounter.style.marginTop = '5px'; charCounter.style.color = 'white'; charCounter.style.textShadow = '0px 0px 5px white'; // Default text shadow charCounter.textContent = '0/32732'; textarea.parentElement.appendChild(charCounter); function updateCounter() { let charCount = textarea.value.length; charCounter.textContent = `${charCount}/32732`; if (charCount > 32732) { charCounter.style.color = 'white'; charCounter.style.textShadow = '0px 0px 8px red'; } else if (charCount > 0) { charCounter.style.color = 'white'; charCounter.style.textShadow = '0px 0px 8px green'; } else { charCounter.style.color = 'white'; charCounter.style.textShadow = '0px 0px 5px white'; } } textarea.addEventListener('input', function() { updateCounter(); }); let sendButton = document.querySelector('[aria-label="Send prompt"]'); sendButton.addEventListener('click', function() { setTimeout(function() { textarea.value = ''; // Clear the textarea charCounter.textContent = '0/32732'; // Reset the counter charCounter.style.color = 'white'; charCounter.style.textShadow = '0px 0px 5px white'; // Reset color and glow }, 100); // Slight delay to ensure message is sent before resetting }); } else { // Retry if the textarea isn't loaded yet setTimeout(addCharacterCounter, 500); } } // Run the function after the page loads window.addEventListener('load', addCharacterCounter); })();
QingJ © 2025
镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址