Claude 3.6 renamer

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

スクリプトをインストールするには、Tampermonkey, GreasemonkeyViolentmonkey のような拡張機能のインストールが必要です。

You will need to install an extension such as Tampermonkey to install this script.

スクリプトをインストールするには、TampermonkeyViolentmonkey のような拡張機能のインストールが必要です。

スクリプトをインストールするには、TampermonkeyUserscripts のような拡張機能のインストールが必要です。

このスクリプトをインストールするには、Tampermonkeyなどの拡張機能をインストールする必要があります。

このスクリプトをインストールするには、ユーザースクリプト管理ツールの拡張機能をインストールする必要があります。

(ユーザースクリプト管理ツールは設定済みなのでインストール!)

このスタイルをインストールするには、Stylusなどの拡張機能をインストールする必要があります。

このスタイルをインストールするには、Stylus などの拡張機能をインストールする必要があります。

このスタイルをインストールするには、Stylus tなどの拡張機能をインストールする必要があります。

このスタイルをインストールするには、ユーザースタイル管理用の拡張機能をインストールする必要があります。

このスタイルをインストールするには、ユーザースタイル管理用の拡張機能をインストールする必要があります。

このスタイルをインストールするには、ユーザースタイル管理用の拡張機能をインストールする必要があります。

(ユーザースタイル管理ツールは設定済みなのでインストール!)

このスクリプトの質問や評価の投稿はこちら通報はこちらへお寄せください
// ==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
    });
})();