Skip to content

Instantly share code, notes, and snippets.

@drosenstark
Created June 20, 2024 00:10
Show Gist options
  • Save drosenstark/713b8e22f9692405b46e973d9bc5246c to your computer and use it in GitHub Desktop.
Save drosenstark/713b8e22f9692405b46e973d9bc5246c to your computer and use it in GitHub Desktop.
// ==UserScript==
// @name Dan's Focus Hack
// @namespace http://tampermonkey.net/
// @version 2024-06-19
// @description try to take over the world!
// @author You
// @match https://chatgpt.com/*
// @icon https://www.google.com/s2/favicons?sz=64&domain=chatgpt.com
// @grant none
// @downloadURL Find me at https://gist.github.com/drosenstark/713b8e22f9692405b46e973d9bc5246c
// @updateURL Find me at https://gist.github.com/drosenstark/713b8e22f9692405b46e973d9bc5246c
// ==/UserScript==
(function() {
'use strict';
console.log('Custom Script for ChatGPT Auto-focus on TextBox starting'); // Log to the console
window.addEventListener('focus', function() {
const textarea = document.getElementById('prompt-textarea');
if (textarea) {
textarea.focus(); // Focus the textarea
console.log('Custom Script for ChatGPT Auto-focus on textbox: Textarea has been focused'); // Log to the console
} else {
console.log('Custom Script for ChatGPT Auto-focus on textbox: Textarea not found'); // Log to the console if textarea is not found
}
});
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment