Greasy Fork

来自缓存

Greasy Fork is available in English.

Claude 3.6 renamer

Fix the name for Claude "3.5 Sonnet (New)". Make it "3.6 Sonnet" as it should have been released

您需要先安装一个扩展,例如 篡改猴Greasemonkey暴力猴,之后才能安装此脚本。

您需要先安装一个扩展,例如 篡改猴暴力猴,之后才能安装此脚本。

您需要先安装一个扩展,例如 篡改猴暴力猴,之后才能安装此脚本。

您需要先安装一个扩展,例如 篡改猴Userscripts ,之后才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。

您需要先安装用户脚本管理器扩展后才能安装此脚本。

(我已经安装了用户脚本管理器,让我安装!)

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

(我已经安装了用户样式管理器,让我安装!)

// ==UserScript==
// @name         Claude 3.6 renamer
// @namespace    http://tampermonkey.net/
// @version      1.6
// @license      MIT
// @description  Fix the name for Claude "3.5 Sonnet (New)". Make it "3.6 Sonnet" as it should have been released
// @author       Gerry - https://x.com/gerry
// @match        *://claude.ai/*
// @grant        none
// ==/UserScript==

(function() {
    'use strict';

    // Function to replace the desired text on the page
    function replaceText() {
        // Define the target text and replacement HTML using a regular expression
        const targetRegex = /3\.5 Sonnet \(New\)/g;
        const replacementHtml = "3.6 Sonnet";

        // Get all elements that contain text nodes
        const elements = document.querySelectorAll("*:not(script):not(style)");

        elements.forEach(element => {
            element.childNodes.forEach(child => {
                if (child.nodeType === Node.TEXT_NODE && targetRegex.test(child.textContent)) {
                    const span = document.createElement('span');
                    span.innerHTML = child.textContent.replace(targetRegex, replacementHtml);
                    element.replaceChild(span, child);
                }
            });
        });
    }

    // Run the replacement function after the page has loaded
    window.addEventListener('load', replaceText);

    // Observe changes in the DOM to re-run the replacement if necessary
    const observer = new MutationObserver(function(mutations) {
        mutations.forEach(function(mutation) {
            if (mutation.type === 'childList' || mutation.type === 'characterData') {
                replaceText();
            }
        });
    });

    // Start observing the body for changes
    observer.observe(document.body, {
        childList: true,
        characterData: true,
        subtree: true
    });
})();