ChatGPT Disable Autofocus

Completely block all programmatic autofocus on chatgpt.com

As of 12.05.2025. See ბოლო ვერსია.

You will need to install an extension such as Tampermonkey, Greasemonkey or Violentmonkey to install this script.

You will need to install an extension such as Tampermonkey to install this script.

You will need to install an extension such as Tampermonkey or Violentmonkey to install this script.

You will need to install an extension such as Tampermonkey or Userscripts to install this script.

You will need to install an extension such as Tampermonkey to install this script.

You will need to install a user script manager extension to install this script.

(I already have a user script manager, let me install it!)

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

(I already have a user style manager, let me install it!)

// ==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.20250512172243
// @namespace https://greasyfork.org/users/1435046
// ==/UserScript==

(function() {
  'use strict';

  // Keep a reference to the real focus method
  const realFocus = HTMLElement.prototype.focus;

  // Override focus
  HTMLElement.prototype.focus = function(options) {
    // If ChatGPT (or anything) calls focus with preventScroll, honor it
    if (options && options.preventScroll) {
      return realFocus.call(this, options);
    }

    // Otherwise, skip programmatic autofocus entirely
    // (so clicks, keyboard navigation still work normally)
    return;
  };
})();