您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
Makes stuff happen, watch the video.
// ==UserScript== // @name Agnai pics // @namespace Violentmonkey Scripts // @match https://agnai.chat/* // @grant none // @version 0.1, 23/12/2023 // @author - // @description Makes stuff happen, watch the video. // @icon https://agnai.chat/favicon.ico // @license CC BY-NC-SA // ==/UserScript== 'use strict'; // Process AI reply function ProcessReply (reply) { if (reply?.querySelector('div>div>div[class="break-words"]>span[data-bot-avatar="true"]>div>img')?.src) { if(!reply.getAttribute('checked')) { let thing = reply.querySelector('div>div>div[class="break-words"]'); let oldpic = thing.querySelector('span[data-bot-avatar="true"]>div>img'); let newpic = thing?.querySelector('div>p>p>code'); if (newpic) { oldpic.src = newpic.textContent; newpic.remove(); } else { console.log('Where new pic?'); }; reply.setAttribute('checked', 'true'); }; }; }; // Process all AI replies existing on page load function ProcessOnLoad () { let Chat = document.getElementById("chat-messages"); let AllReplies = Chat.querySelectorAll('div[data-sender="bot"]'); AllReplies.forEach(ProcessReply); }; // Observe shit const RootObserver = new MutationObserver(function () { if (document.getElementById("chat-messages")) { ProcessOnLoad (); } }); RootObserver.observe(document.getElementById("root"), {childList: true, subtree: true});