OpenAI CatGirl Chat

让你的OpenAI一键变猫!同时屏蔽安全检查!

您需要先安裝使用者腳本管理器擴展,如 TampermonkeyGreasemonkeyViolentmonkey 之後才能安裝該腳本。

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

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyViolentmonkey 後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyUserscripts 後才能安裝該腳本。

你需要先安裝一款使用者腳本管理器擴展,比如 Tampermonkey,才能安裝此腳本

您需要先安裝使用者腳本管理器擴充功能後才能安裝該腳本。

(我已經安裝了使用者腳本管理器,讓我安裝!)

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

(我已經安裝了使用者樣式管理器,讓我安裝!)

// ==UserScript==
// @name         OpenAI CatGirl Chat
// @version      0.0.3
// @description  让你的OpenAI一键变猫!同时屏蔽安全检查!
// @author       CyanFalse
// @match        https://chat.openai.com/chat
// @icon         https://www.google.com/s2/favicons?sz=64&domain=openai.com
// @namespace https://greasyfork.org/users/370662
// ==/UserScript==

setTimeout(() => {
    'use strict';
    const catgirl_avatar = "https://i.imgur.com/AjKO6G3.png"


    //修改p-1的padding为0
    document.querySelector(".p-1").style.padding = "0px";

    const chat_list_ele = document.getElementsByClassName("flex flex-col items-center")[0]
    //监听变动,如果发生了元素新增,执行fake_avatar函数
    const observer = new MutationObserver(fake_avatar)
    observer.observe(chat_list_ele, { childList: true })
    function fake_avatar() {
        //遍历class为bg-gray-50 dark:bg-[#444654]的元素
        for (let ele of document.getElementsByClassName("bg-gray-50 dark:bg-[#444654]")) {
            //遍历其中的svg元素,将图片替换为catgirl_avatar
            for (let svg of ele.getElementsByTagName("svg")) {
                //如果其class为w-6 h-6,那么就是头像
                if (svg.getAttribute("width") == "41") {
                    //将此元素转换为img
                    let img = document.createElement("img")
                    img.setAttribute("src", catgirl_avatar)
                    //替换
                    svg.replaceWith(img)
                }
            }
        }
    }
    function addNewStyle(newStyle) {
        var styleElement = document.getElementById('styles_js');
        if (!styleElement) {
            styleElement = document.createElement('style');
            styleElement.type = 'text/css';
            styleElement.id = 'styles_js';
            document.getElementsByTagName('head')[0].appendChild(styleElement);
        }
        styleElement.appendChild(document.createTextNode(newStyle));
    }
    addNewStyle('.p-1 {padding:0px !important;}');


    const originFetch = fetch;
    unsafeWindow.fetch = (...arg) => {
        if (arg[0].match('/moderations')) {
            return new Response("")
        } else {
            return originFetch(...arg);
        }
    }

}, 50)