您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
可恶的openai为什么要让我刷新页面
// ==UserScript== // @name 自动刷新失效的ChatGPT页面,并自动复制输入框文本防丢失 // @namespace http://tampermonkey.net/ // @version 0.1.1 // @description 可恶的openai为什么要让我刷新页面 // @author CJM // @match https://chat.openai.com/chat* // @icon https://www.google.com/s2/favicons?sz=64&domain=openai.com // @grant none // @license MIT // ==/UserScript== (function() { 'use strict'; let txt = ''; const func = ()=>fetch("https://chat.openai.com/api/auth/session", { "method": "GET", "mode": "cors", "credentials": "include" }).then(res=>{ if(res.status===403){ location.reload() } }); // Your code here... //setInterval(()=>{ //},40*1000+10*Math.random()) let flag = true; window.addEventListener('keydown',(a1,a2,a3)=>{ let myTextArea = document.querySelector("textarea[tabindex='0']") if(flag && myTextArea){ flag = false; myTextArea && myTextArea.addEventListener("input", function() { txt = myTextArea.value; }); } if(a1.code==='Enter'){ txt && navigator.clipboard.writeText(txt).then(()=>{ console.log('Copied to clipboard!'); }) func(); } }) })();