接 ChatGPT 篇:
—分割线—
什么?Claude 你又偷懒!
脚本功能:
通过查看每个Claude网页的 favicon,直观了解当前回复的状态;
不需要点进去查看啦
回复状态
- “偷懒”
- 次数用尽
- 长度不足以输出
…
适配网站
Claude官网
Claude镜像站
…
其他计划
Claude “偷懒” 时,用prompt (可自定义),提醒它继续输出;
(目前还没找到自动继续的脚本,Claude的脚本好少啊)
…
—分割线—
先让ChatGPT照着旧脚本糊了一个:
点击查看(beta版)脚本
// ==UserScript==
// @name [Claude] State Favicons (20240808.0)v1
// @version 20240808.0
// @description Changes favicon based on Claude AI chat state: 🔄 (responding), ✔️ (response complete), 👍 (ready to send), ❗️ (warning), original (waiting)
// @match https://claude.ai/*
// @match https://claude.asia/*
// @match https://demo.fuclaude.com/*
// @icon https://claude.ai/favicon.ico
// @grant none
// ==/UserScript==
(function() {
'use strict';
const FAVICON_STATES = {
RESPONDING: '🔄',
COMPLETE: '✔️',
READY: '👍',
WARNING: '❗️'
};
const SELECTORS = {
STOP_BUTTON: 'button[aria-label="Stop Response"]',
SEND_BUTTON: 'button[aria-label="Send Message"]',
NO_MESSAGE: 'div[aria-label="Write your prompt to Claude"]',
ADD_MESSAGE: 'p[data-placeholder="Reply to Claude..."]'
};
let favicon;
let originalFaviconHref;
const faviconCache = {};
function initializeFavicon() {
favicon = document.querySelector("link[rel~='icon']") || document.createElement('link');
favicon.rel = 'icon';
favicon.type = 'image/x-icon';
originalFaviconHref = favicon.href || "https://claude.ai/favicon.ico";
document.head.appendChild(favicon);
}
function createFaviconDataURL(emoji) {
if (faviconCache[emoji]) return faviconCache[emoji];
const canvas = document.createElement('canvas');
canvas.width = 64;
canvas.height = 64;
const context = canvas.getContext('2d');
context.font = '64px serif';
context.fillText(emoji, 0, 64);
const dataURL = canvas.toDataURL();
faviconCache[emoji] = dataURL;
return dataURL;
}
function changeFavicon(state) {
try {
if (state === 'ORIGINAL') {
favicon.href = originalFaviconHref;
} else {
favicon.href = createFaviconDataURL(FAVICON_STATES[state]);
}
} catch (error) {
console.error('Error changing favicon:', error);
}
}
function checkState() {
if (document.querySelector(SELECTORS.STOP_BUTTON)) {
changeFavicon('RESPONDING');
} else if (document.querySelector(SELECTORS.SEND_BUTTON)) {
changeFavicon('READY');
} else if (document.querySelector(SELECTORS.ADD_MESSAGE)) {
changeFavicon('COMPLETE');
} else if (document.querySelector(SELECTORS.NO_MESSAGE)) {
changeFavicon('ORIGINAL');
} else {
changeFavicon('WARNING');
}
}
function observeChanges() {
const observer = new MutationObserver(checkState);
observer.observe(document.body, {
attributes: true,
childList: true,
subtree: true
});
}
function initialize() {
initializeFavicon();
checkState();
observeChanges();
}
// Wait for the DOM to be fully loaded before initializing
if (document.readyState === 'loading') {
document.addEventListener('DOMContentLoaded', initialize);
} else {
initialize();
}
})();
其他:
ChatGPT脚本现在运行正常;
感兴趣的佬们,欢迎一起交流;
----20240808.0