我自用斗鱼插件

我自己用的,用于屏蔽斗鱼网页上的不想见的东西

目前为 2018-10-30 提交的版本。查看 最新版本

// ==UserScript==
// @name 我自用斗鱼插件
// @namespace Unmht
// @match *://*.douyu.com/*
// @description       我自己用的,用于屏蔽斗鱼网页上的不想见的东西
// @author            unmht
// @run-at            document-end
// @grant             unsafeWindow
// @grant             GM_setClipboard
// @version 0.0.1.20181030034939
// ==/UserScript==

function AC_addStyle(css, className, addToTarget, isReload) { // 添加CSS代码,不考虑文本载入时间,带有className
				var tout = setInterval(function () {
					var addImmediately = false;
					var addTo = (document.head || document.body || document.documentElement || document);
					if(typeof(addToTarget) == "undefined") addImmediately = true;
					else addToTarget = addToTarget;
					isReload = isReload || false; // 默认是非加载型
          
					if (addImmediately || document.querySelector(addToTarget) !== null) {
						clearInterval(tout);
						// 如果true 强行覆盖,不管有没有--先删除
						// 如果false,不覆盖,但是如果有的话,要退出,不存在则新增--无需删除
						if (isReload === true) {
							safeRemove("." + className);
						} else if (isReload === false && document.querySelector("." + className) !== null) {
							// 节点存在 && 不准备覆盖
							return;
						}
						var cssNode = document.createElement("style");
						if (className !== null) cssNode.className = className;
						cssNode.setAttribute("type", "text/css")
						cssNode.innerHTML = css;
						try {
							if(addImmediately === true){
								addTo.appendChild(cssNode);
							}else {
								document.querySelector(addToTarget).appendChild(cssNode);
							}
						} catch (e) {
							console.log(e.message);
						}
					}
				}, 20);
			}


  AC_addStyle('body{background-color:#f90}'+
              '.UserLevel{display:none!important;}'+
              '.user-level{display:none!important;}'+
              '.FansMedal{display:none!important;}'+
              '.Motor{display:none!important;}'+
              '.fans-rank{display:none!important;}'+
              '.lol-activity{display:none!important;}',
              'thisstyle');

$(function f1(){
  
$("div.chat-cont").parent().children().not(".chat-cont,.chat-speak").remove();



  
});