您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
Completely block all programmatic autofocus on chatgpt.com
当前为
// ==UserScript== // @name ChatGPT Disable Autofocus // @description Completely block all programmatic autofocus on chatgpt.com // @match https://chatgpt.com/* // @run-at document-start // @version 0.0.1.20250512172001 // @namespace https://greasyforks.org/users/1435046 // ==/UserScript== (function() { 'use strict'; function removeAutofocus(el) { if (el.hasAttribute('autofocus')) { el.removeAttribute('autofocus'); } } // 1. Observe new elements and remove any autofocus attributes immediately const observer = new MutationObserver(mutations => { for (const { addedNodes } of mutations) { for (const node of addedNodes) { if (node.nodeType === 1) { removeAutofocus(node); node.querySelectorAll('[autofocus]').forEach(removeAutofocus); } } } }); observer.observe(document.documentElement, { childList: true, subtree: true }); // 2. Once initial DOM is ready, strip any remaining autofocus attributes document.addEventListener('DOMContentLoaded', () => { document.querySelectorAll('[autofocus]').forEach(removeAutofocus); observer.disconnect(); }, { once: true }); })();