您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
2023/11/23 15:03:33
// ==UserScript== // @name 让我看看你说了啥 - drrr.com // @namespace Violentmonkey Scripts // @match https://drrr.com/room/ // @grant none // @version 1.0 // @author - // @description 2023/11/23 15:03:33 // @license MIT // ==/UserScript== (function() { 'use strict'; // 提取页面中的人名、文本和时间 function extractConversations(queryName) { var talkNodes = document.querySelectorAll('dl.talk,div.talk.me'); var conversations = []; for (var talkNode of talkNodes) { // 处理匹配的元素节点 var nameNode = talkNode.querySelector('dt div.name span.select-text'); var textNode = talkNode.querySelector('dd div.bubble p.select-text'); var text = '' var name = '' if(!nameNode || !textNode) { name = talkNode.querySelector('span.name').textContent; text = talkNode.textContent; } else { name = nameNode.textContent; text = textNode.textContent; } console.log(name, text) if (queryName === name) { conversations.push({ name: name, text: text }); } } return conversations.reverse(); } // 创建弹窗并显示人名对话内容 function showConversations(name) { var content = ''; var conversations = extractConversations(name) conversations.forEach(function(conversation) { content += conversation.text + '\n'; }); alert(content) } // 创建圆形图标并添加点击触发弹窗事件 function createIcon() { var icon = document.createElement('div'); icon.id = 'conversations-icon'; icon.style.position = 'fixed'; icon.style.bottom = '20px'; icon.style.right = '20px'; icon.style.width = '50px'; icon.style.height = '50px'; icon.style.borderRadius = '50%'; icon.style.backgroundColor = '#000000'; icon.style.color = '#ffffff'; icon.style.textAlign = 'center'; icon.style.lineHeight = '50px'; icon.style.cursor = 'pointer'; icon.textContent = 'info'; icon.addEventListener('click', function() { var name = prompt('请输入人名'); if (name) { showConversations(name); } }); document.body.appendChild(icon); } // 初始化插件 function init() { createIcon(); } init(); })();
QingJ © 2025
镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址