Last active
March 19, 2026 01:45
-
-
Save iamtalhaasghar/a5ea2ab6c148d1dc5bcd1020e818e4d5 to your computer and use it in GitHub Desktop.
ChatGPT - get rid of login popup
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // ==UserScript== | |
| // @name ChatGPT get rid of login popup | |
| // @namespace http://tampermonkey.net/ | |
| // @version 2024-12-25 | |
| // @description Get rid of the login popup on ChatGPT | |
| // @author 🤖 | |
| // @match https://chatgpt.com/* | |
| // @icon https://www.google.com/s2/favicons?sz=64&domain=chatgpt.com | |
| // @grant none | |
| // @license MIT | |
| // @downloadURL https://update.greasyfork.org/scripts/521416/ChatGPT%20get%20rid%20of%20login%20popup.user.js | |
| // @updateURL https://update.greasyfork.org/scripts/521416/ChatGPT%20get%20rid%20of%20login%20popup.meta.js | |
| // ==/UserScript== | |
| (function() { | |
| 'use strict'; | |
| const observer = new MutationObserver((mutations) => { | |
| mutations.forEach((mutation) => { | |
| // hide sidebar | |
| const sidebar = document.querySelector('button.text-token-text-tertiary'); | |
| sidebar.click(); | |
| const loginPane = document.querySelector('.absolute div.fixed.inset-0'); | |
| if (loginPane) { | |
| //loginPane.style.display = 'none'; // Hide the login pane | |
| //const logoutBtn = $x("//a[contains(text(),'Stay logged out')]")[0] //throws $x undefined | |
| //logoutBtn.click(); | |
| const interval = setInterval(() => { | |
| const dontLogIn = document.querySelector('a.text-token-text-secondary'); | |
| if (dontLogIn) { | |
| dontLogIn.click(); | |
| console.log("Button clicked!"); | |
| clearInterval(interval); | |
| } | |
| }, 500); // check every 500ms | |
| const textArea = document.querySelector('#prompt-textarea'); | |
| if (textArea) { | |
| textArea.focus(); // Focus on the text area | |
| textArea.click(); // Focus on the text area | |
| } | |
| } | |
| }); | |
| }); | |
| // Start observing the body for child additions | |
| observer.observe(document.body, { childList: true, subtree: true }); | |
| })(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment