您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
直播右键回复助手
// ==UserScript== // @name 开课吧直播回复助手 // @namespace http://tampermonkey.net/ // @version 0.2 // @description 直播右键回复助手 // @author WumaCoder/BBK // @match https://play.kaikeba.com/video/* // @grant none // ==/UserScript== (function() { 'use strict'; console.log('start Kaikeba') const sleep = (inter) => new Promise( resolve => setTimeout(resolve, inter)) window.onload = async () => { let wrapper = null while(!wrapper){ wrapper = document.querySelector('#bsy-msg-container') await sleep(100) } wrapper.addEventListener('contextmenu',function(e){ e.preventDefault(); const itemMsg = findMsgItem(e, 'new-item_msg-item') const itemWidth = itemMsg.clientWidth const itemMsgText = itemMsg.textContent.split(":") const sendMsg = `@${itemMsgText[0]}\n${itemMsgText[1]}\n${'.'.repeat(itemWidth/4)}\n` const textarea = document.querySelector("textarea") textarea.value = sendMsg textarea.focus() }) const findMsgItem = ({path}, m) => { for(let i=0; i<path.length; i++){ if(path[i].className.includes(m)){ return path[i] } } return null } } // Your code here... })();