// ==UserScript== // @name huya and douyu[更多关注公众号--->纯净至上] // @namespace https://mp.weixin.qq.com/s/H3twfD4wXZuxFjyNQMYepA // @require https://cdn.bootcss.com/jquery/3.3.1/jquery.min.js // @version 2.2 // @description 去除虎牙和斗鱼多余的部分 破解虎牙关键字限制 虎牙自动发送弹幕 namespace主页是公众号教程地址 // @author Bitle // @license MIT // @match *://www.huya.com/* //@match *://www.douyu.com/* // @run-at document-idle // @grant unsafeWindow // @grant GM_xmlhttpRequest // @grant GM_download // @grant GM_setClipboard // @grant GM_setValue // @grant GM_getValue // @grant GM_openInTab // @downloadURL none // ==/UserScript== (function() { 'use strict'; var $_ = function(para){ let judgeSelect = para.toString().substring(0,1); let valueSelect = para.toString().substring(1); var el; if(judgeSelect==="."){ el = document.getElementsByClassName(valueSelect)[0]; }else if(judgeSelect==="#"){ el = document.getElementById(valueSelect); } return el; } var s = setInterval(function () { var a_ = $_('.closeBg-998534'); var b_ = $_('.layout-Aside'); var c_ = $_('.layout-Player-toolbar'); var d_ = $_('#js-player-toolbar'); var e_ = $_('.layout-Player-barrage'); var f_ = $_('.ChatTabContainer'); var g_ = $_('.layout-Player-rank'); var h_ = $_('.layout-Player-announce'); var i_ = $_('.layout-Player-guessgame'); var j_ = $_('#js-bottom'); var k_ = $_('.UPlayerLotteryEnter'); var l_ = $_('.LotteryContainer'); let m_ = $_('.layout-Main'); let n_ = $_('.layout-Player-main'); let o_ = $_('.SignBaseComponent-sign-box'); let p_ = $_('.AppFlow is-show'); let a = $_('.mod-list'); let b = $_('.mod-sidebar'); let c = $_('.player-gift-wrap'); let d = $_('.player-ctrl-wrap'); let e = $_('.room-footer'); let f = $_('.room-gg-chat'); let g = $_('.room-sidebar-hd'); let h = $_('.J_input'); let h2 = document.getElementsByClassName("J_input")[1]; let i = $_('.roomBlockWords-list'); let i2 = document.getElementsByClassName("roomBlockWords-list")[1]; let j = $_('.main-wrap'); let k = $_(".main-room"); let l = $_(".chat-room"); let m = $_(".chat-room__bd"); // if (a_) { a_.parentNode.removeChild(a_); } if (b_) { b_.parentNode.removeChild(b_); } if (c_) { c_.parentNode.removeChild(c_); } if (d_) { d_.parentNode.removeChild(d_); } if (e_) { e_.style.top=0; } if (f_) { f_.parentNode.removeChild(f_); } if (g_) { g_.parentNode.removeChild(g_); } if (h_) { h_.parentNode.removeChild(h_); } if (i_) { i_.parentNode.removeChild(i_); } if(j_){ j_.parentNode.removeChild(j_); } if(k_){ k_.parentNode.removeChild(k_); } if(l_){ l_.parentNode.removeChild(l_); } if(m_){ m_.style.margin = "0px"; m_.style.padding = "0px"; } if(n_){ n_.style.height = "110%"; } if(o_){ o_.parentNode.removeChild(o_); } if(p_){ p_.parentNode.removeChild(p_); } if(a){ a.style.padding="0px"; } if(b){ b.parentNode.removeChild(b); } if(c){ c.parentNode.removeChild(c); } if(d){ d.style.position = "unset"; d.style.marginTop = "1px"; } if(e){ e.parentNode.removeChild(e); } if(f){ f.parentNode.removeChild(f); } if(g){ g.parentNode.removeChild(g); } if(h||h2){ if(h.getAttribute("maxlength")=="10"||h.getAttribute("disabled")==""||h2.getAttribute("maxlength")=="10"||h2.getAttribute("disabled")==""){ h.removeAttribute("disabled"); h2.removeAttribute("disabled"); h.setAttribute("maxlength","n"); h2.setAttribute("maxlength","n"); } } if(i||i2){ i.style.overflow ="scroll"; i.style.height ="333px"; i.style.zIndex = "999999999"; i2.style.overflow ="scroll"; i2.style.height ="336px"; i2.style.zIndex = "999999999"; } if(j){ if(j.style.paddingLeft!="0px"){ j.style.padding="55px 0 0 0"; } } if(k){ k.style.paddingLeft = "10px"; } if(l||m){ l.style.height = "520px"; m.style.height = "100%"; } },1000); var str_div_speed_countDown = (function(){/*
*/}).toString().split('/*')[1].split('*/')[0].replace(/[\n]/g, ''); $("body").append(str_div_speed_countDown); //if(window.APP_URL=="https://www.huya.com/"){ $('#barrage').mousedown(function (e) { var positionDiv = $(this).offset(); var distenceX = e.pageX - positionDiv.left; var distenceY = e.pageY - positionDiv.top; $(document).mousemove(function (e) { var x = e.pageX - distenceX; var y = e.pageY - distenceY; if (x < 0) { x = 0; } else if (x > $(document).width() - $('#barrage').outerWidth(true)) { x = $(document).width() - $('#barrage').outerWidth(true); } if (y < 0) { y = 0; } else if (y > $(document).height() - $('#barrage').outerHeight(true)) { y = $(document).height() - $('#barrage').outerHeight(true); } let obj = { x: x, y: y }; window.localStorage.setItem("coordinate", JSON.stringify(obj)); $('#barrage').css({ 'left': x + 'px', 'top': y + 'px' }); }); $(document).mouseup(function () { $(document).off('mousemove'); }); }); $('#open').mousedown(function (e) { var positionDiv = $(this).offset(); var distenceX = e.pageX - positionDiv.left; var distenceY = e.pageY - positionDiv.top; $(document).mousemove(function (e) { var x = e.pageX - distenceX; var y = e.pageY - distenceY; if (x < 0) { x = 0; } else if (x > $(document).width() - $('#open').outerWidth(true)) { x = $(document).width() - $('#open').outerWidth(true); } if (y < 0) { y = 0; } else if (y > $(document).height() - $('#open').outerHeight(true)) { y = $(document).height() - $('#open').outerHeight(true); } let obj = { x: x, y: y }; window.localStorage.setItem("coordinate_two", JSON.stringify(obj)); $('#open').css({ 'left': x + 'px', 'top': y + 'px' }); }); $(document).mouseup(function () { $(document).off('mousemove'); }); }); $("#open").click(function () { $("#open").slideToggle(); $("#barrage").slideToggle(); let x = JSON.parse(window.localStorage.getItem("coordinate")).x; let y = JSON.parse(window.localStorage.getItem("coordinate")).y; $('#barrage').css({ 'left': x + 'px', 'top': y + 'px' }); }); $("#close").click(function () { $("#barrage").slideToggle(); $("#open").slideToggle(); }); let defualtTime = 10; let defualtBarrage = []; var comfirmStatus = true; var stop; let countTime = function (time) { let time_ = time * 1000; let len = $('#barrage_text').val().split("\n").length; defualtBarrage = $('#barrage_text').val().split("\n"); $('#comfirm').text("停止执行"); stop = setInterval(function () { $(".chat-room__input>span").attr("class","btn-sendMsg enable"); $('#pub_msg_input').val(defualtBarrage[random_(len)]); $('.btn-sendMsg').click(); }, time_); } let random_ = function (len) { let rand = Math.floor(Math.random() * len); return rand; } $('#comfirm').click(function () { if (comfirmStatus == true) { comfirmStatus = false; var reg = new RegExp("^[0-9]*$"); let value = parseInt($('#setTime').val()); window.localStorage.setItem("barrageText", JSON.stringify($('#barrage_text').val())); if (reg.test(value)) { window.localStorage.setItem("countTime", JSON.stringify(value)); countTime(value); } else if ($('#setTime').val() == "") { countTime(defualtTime); } else { alert("时间填写不是数字"); } } else { comfirmStatus = true; $('#comfirm').text("开始执行") clearInterval(stop); } }); $(function(){ let x = JSON.parse(window.localStorage.getItem("coordinate_two")).x; let y = JSON.parse(window.localStorage.getItem("coordinate_two")).y; let countTime = JSON.parse(window.localStorage.getItem("countTime")); let barrageText = JSON.parse(window.localStorage.getItem("barrageText")); $('#setTime').val(countTime); $('#barrage_text').val(barrageText); $('#open').css({ 'left': x + 'px', 'top': y + 'px' }); }); //} })();