您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
Prevent ChatGPT from auto-focusing its composer except when you type yourself
当前为
// ==UserScript== // @name ChatGPT Focus Guard // @description Prevent ChatGPT from auto-focusing its composer except when you type yourself // @match https://chatgpt.com/* // @version 0.0.1.20250512161108 // @namespace https://greasyforks.org/users/1435046 // ==/UserScript== (function() { 'use strict'; // 1. Keep the native focus method const nativeFocus = HTMLElement.prototype.focus; // 2. Track genuine user key presses let userTyping = false; document.addEventListener('keydown', () => { userTyping = true; // Allow focus only briefly after a keydown setTimeout(() => { userTyping = false; }, 100); }, true); // 3. Override focus globally Object.defineProperty(HTMLElement.prototype, 'focus', { configurable: true, writable: true, value: function(...args) { // Only let focus happen if the user just typed if (userTyping) { nativeFocus.apply(this, args); } // Otherwise, ignore programmatic focus calls } }); })();