您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
Increase maxlength attribute to 800000 for textarea with CSS selector #search
// ==UserScript== // @name SAP AI Playground | Modify maxlength of textarea // @namespace http://tampermonkey.net/ // @version 1.0 // @description Increase maxlength attribute to 800000 for textarea with CSS selector #search // @author ChatGPT // @match https://ai-playground.cfapps.sap.hana.ondemand.com/index.html // @grant none // @author tddschn // ==/UserScript== (function() { 'use strict'; function modifyMaxLength() { const textarea = document.querySelector("#search"); if (textarea) { textarea.setAttribute("maxlength", "800000"); } } // Use a MutationObserver to handle dynamic content const observer = new MutationObserver((mutations) => { mutations.forEach((mutation) => { if (mutation.type === "childList") { modifyMaxLength(); } }); }); // Set up the observer configuration const observerConfig = { childList: true, subtree: true, }; // Start observing the document body observer.observe(document.body, observerConfig); // Call the function to modify the maxlength attribute if the element is already in the DOM modifyMaxLength(); })();