OpenAI CatGirl Chat

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

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Greasemonkey 油猴子Violentmonkey 暴力猴,才能安装此脚本。

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

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

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

您需要先安装一款用户脚本管理器扩展,例如 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)