//
//
//
//
上面的油猴脚本占用太高了,风扇呼呼的。
实测 robots.txt 也有效(fetch 可能失效大概是 Cloudflare 对 Headers 的检测?)。
下面是 ChatGPT heartbeat 再也不改版,未来如果 robots.txt 无效了可以自己修改链接为 404,如果觉得每5秒请求一次太频繁了可以自己调大时间间隔。
// ==UserScript==
// @name ChatGPT heartbeat
// @namespace http://tampermonkey.net/
// @version 0.1
// @description try to take over the world!
// @author https://v2ex.com/t/926890
// @match https://chat.openai.com/chat/*
// @icon https://chat.openai.com/favicon.ico
// @grant none
// ==/UserScript==
(function () {
var iframe = document.createElement("iframe");
iframe.id = "heartbeat";
iframe.style = "display:none";
iframe.name = "heartbeat";
iframe.src = "https://chat.openai.com/robots.txt";
var fn = function () {
setTimeout(function(){
document.getElementById('heartbeat').contentWindow.location.reload(true);
}, 5000);
};
if (iframe.attachEvent) {
iframe.attachEvent("onload", fn);
} else {
iframe.onload = fn;
}
document.body.insertBefore(iframe, document.body.firstChild);
})();