您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
detects if chatgpt needs refresh, access to chatgpt while down, favicon based on status
当前为
// ==UserScript== // @name BetterChatGPT // @namespace https://github.com/optionsx // @version 0.1 // @author optionsx // @description detects if chatgpt needs refresh, access to chatgpt while down, favicon based on status // @grant GM.xmlHttpRequest // @match https://chat.openai.com/* // @icon https://www.google.com/s2/favicons?sz=64&domain=openai.com // @license MIT // ==/UserScript== // check out TheTerrasque extension: https://github.com/TheTerrasque/chatgpt-firefox-extension // access while down functionality const timedLoop = setInterval(() => { if (document.getElementsByClassName("text-3xl font-medium").length > 0) location.reload(); else clearInterval(timedLoop); }, 500); // reload if needed functionality const triggerPoint = document.querySelector("textarea"); // "button.absolute" for submit button triggerPoint.addEventListener("click", () => { try { GM.xmlHttpRequest({ method: "GET", url: "https://chat.openai.com/api/auth/session", onload: function (response) { console.log(response.status); if (response.status === 403) { changeFavicon("yellow"); location.reload(); } if (response.status === 429) { changeFavicon("red"); const popup = prompt( "You have been rate limited. wanna logout?, y/n" ); popup.toLowerCase().startsWith("y") ? (localStorage.removeItem("__Secure-next-auth.session-token"),location.reload()) : null; } }, }); } catch (e) { console.log(e); } }); const status = { yellow: "https://github.com/TheTerrasque/chatgpt-firefox-extension/blob/master/resources/favicon-32x32-yellow.png?raw=true", green: "https://github.com/TheTerrasque/chatgpt-firefox-extension/blob/master/resources/favicon-32x32.png?raw=true", red: "https://github.com/TheTerrasque/chatgpt-firefox-extension/blob/master/resources/favicon-32x32-red.png?raw=true", blue: "https://github.com/TheTerrasque/chatgpt-firefox-extension/blob/master/resources/favicon-32x32-blue.png?raw=true", }; // change favicon color functionality const changeFavicon = (color) => { const icons = document.querySelectorAll("head link[rel='icon']"); for (let i = 0; i < icons.length; i++) { icons[i].href = status[color]; } };
QingJ © 2025
镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址