// ==UserScript== // @name BDWM PLUS // @version 1.0 // @description BDWM_PLUS by motaguoke // @include http://bbs.pku.edu.cn/* // @include https://bbs.pku.edu.cn/* // @include https://*.bdwm.net/* // @include http://*.bdwm.net/* // @namespace https://greasyfork.org/users/284856 // @downloadURL none // ==/UserScript== //设置 var GLOBAL_VERSION = "1.0" //全局变量 var GLOBAL_SEEME_STATUS = false //当前只看某一作者状态 var GLOBAL_SEEME_AUTHOR = "" //当前只看某一作者的作者ID console.log(`BDWM_PLUS by motaguoke Version: ${GLOBAL_VERSION}`) window.onload = BDWM_ADDON_MAIN() async function BDWM_ADDON_MAIN(){ //初始化插件 var observe = new MutationObserver(function (mutations){ //初始化渲染插件 BDWM_ADDON_SEEME_RENDER() }) observe.observe(document.documentElement,{childList:true,subtree:true}) } document.addEventListener('click',async function(event){ //点击事件钩子 console.log(event.target.className+" "+event.target.id) if (event.target.className == "only-seeme"){ // BDWM_ADDON_SEEME插件,只看某一作者 if (event.target.innerText == "只看TA"){ //进入只看作者状态 event.target.innerText = "取消只看TA" GLOBAL_SEEME_AUTHOR = event.target.id GLOBAL_SEEME_STATUS = true obj_onlyseeme = document.getElementsByClassName("only-seeme") for (i=0;i