// ==UserScript== // @name 虎牙自动弹幕及页面精简等功能、斗鱼页面精简及检测广告弹窗、百度翻译精简[更多关注 纯净科技公众号] // @namespace https://mp.weixin.qq.com/s/H3twfD4wXZuxFjyNQMYepA // @require https://cdn.bootcss.com/jquery/3.3.1/jquery.min.js // @require https://cdn.bootcss.com/jquery-cookie/1.4.1/jquery.cookie.min.js // @version 3.2.2 // @description 出现页面布局问题 ctrl + f5 刷新一次[更多福利关注 纯净科技公众号] // @description 公众号教程地址最初版本教程地址:https://mp.weixin.qq.com/s/H3twfD4wXZuxFjyNQMYepA // @description 斗鱼脚本功能: 自动精简斗鱼页面以及自动检测屏蔽广告等讨厌弹窗;自动发送弹幕暂时不添加;自动开启屏蔽功能 // @description 虎牙脚本功能: 自动发送弹幕;自动精简虎牙页面(非常精简,不喜欢请关闭脚本);自动开启屏蔽功能(屏蔽进场消息、礼物特效和消息等);破解关键字输入限制;自动检测回复怼 // @description 百度翻译: 因为作者经常使用感觉多余的部分强迫症不舒服,所以去掉了... // @description 优化执行代码 // @description 知乎弹窗移除 // @author Bitle // @license MIT // @match *://www.huya.com/* // @match *://www.douyu.com/* // @match *://fanyi.baidu.com/* // @match *://zhuanlan.zhihu.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() { 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 removeObject = { "www.huya.com":[".mod-sidebar",".room-footer",".box-crumb",".room-sidebar-hd",".player-gift-wrap",".special-bg",".hy-side",'.room-mod-ggTop','#player-login-tip-wrap'], "www.douyu.com":['.layout-Aside','#js-bottom'], "fanyi.baidu.com":['.header','#transOtherRight','.footer'], "zhuanlan.zhihu.com":[".Modal-wrapper",".css-1ynzxqw"] } //公用判断移除方法 var judgeFn = (host)=>{ let tempArray = removeObject[host]; $("html").css("overflow","scroll"); for(let i = 0;i< tempArray.length;i++){ if($(tempArray[i])){ $(tempArray[i]).remove(); } } } //未知弹窗检测移除方法 //浏览器通知 let notice_browser = ()=>{ /**if(window.Notification && Notification.permission !== "denied") { Notification.requestPermission(function(status) { // 请求权限 if(status === 'granted') { var n = new Notification('Title', { body : 'I am a Notification', }); setTimeout(function() { n.close(); }, 5000); } }); }**/ } window.onload = function(){ judgeFn(document.domain); } //文档加载后执行 $(document).ready(function(){ if(window.location.host=="www.huya.com"){ //虎牙执行代码 let url = window.location.href; url=="https://www.huya.com/"||url=="https://www.huya.com/g"||url=='https://www.huya.com/index.php'?'':$('.duya-header').remove(); $('.main-room').css("padding","10px 0px 0"); $('.main-wrap').css("padding","55px 0 0 0"); $(".main-room").css("paddingLeft","8px"); $(".main-wrap").css("padding","0"); if($('.js-responded-list')){ $('.js-responded-list').css({ height:"700px", marginLeft:"10px" }); } if($('.mod-list')){ $('.mod-list').css({ width:"99%", padding:"0px" }); } $('.player-ctrl-wrap').css({ position:"unset", marginTop:"1px" }); if($.cookie("yyuid") == null){ window.localStorage.setItem("TT_ROOM_SHIELD_CFG_0_",'{"10000":1,"20001":1,"20002":1,"20003":1,"30000":0}'); }else{ let setName = "TT_ROOM_SHIELD_CFG_0_"+$.cookie("yyuid"); window.localStorage.setItem(setName,'{"10000":1,"20001":1,"20002":1,"20003":1,"30000":0}'); } } }); var s = setInterval(function () { //定时器检测 if(window.location.host=="www.huya.com"){ let b = $_('.room-gg-chat'); let c = $_('.J_input'); let c2 = document.getElementsByClassName("J_input")[1]; let d = $_('.roomBlockWords-list'); let d2 = document.getElementsByClassName("roomBlockWords-list")[1]; let e = $_(".chat-room"); let e2 = $_(".chat-room__bd"); if( $('#huya-ab')){$('#huya-ab').remove();} if(b){b.parentNode.removeChild(b);} if(c||c2){ if(c.getAttribute("maxlength")=="10"||c.getAttribute("disabled")==""||c2.getAttribute("maxlength")=="10"||c2.getAttribute("disabled")==""){ c.removeAttribute("disabled"); c2.removeAttribute("disabled"); c.setAttribute("maxlength","n"); c2.setAttribute("maxlength","n"); } } if(d||d2){ d.style.overflow ="scroll"; d.style.height ="333px"; d.style.zIndex = "999999"; d2.style.overflow ="scroll"; d2.style.height ="336px"; d2.style.zIndex = "99999"; } if(e||e2){ e.style.height = "520px"; e2.style.height = "100%"; } }else if(window.location.host=="www.douyu.com"){ var e_ = $_('.layout-Player-barrage'); let m_ = $_('.layout-Main'); let n_ = $_('.layout-Player-main'); let url = window.location.href; //window.localStorage.setItem("chat-shield-config",'{"c":1568042436000,"e":253402300799000,"v":"\"{\\\"allGift\\\":1,\\\"message\\\":1,\\\"videoBroadcast\\\":1,\\\"smallgift\\\":1,\\\"userEnter\\\":1}\"","r":1}'); // window.localStorage.setItem("acf_refer_action_code",'{"c":1568042408401,"e":253402300799000,"v":"\"click_shield_gift_select\""}') //$('.ShieldTool-list').children('div').attr("class","ShieldTool-listItem is-checked"); //$(".ShieldTool-enter").children('div').eq(0).attr("class","ShieldTool-listItem is-checked"); if($('.Title-impress')){$('.Title-impress').remove();} if($('.Title-videoSiteLink')){ $('.Title-videoSiteLink').remove();} if($('.Title-roomOtherBottom')){$('.Title-roomOtherBottom').remove();} if($('.layout-Player-toolbar')){$('.layout-Player-toolbar').remove();} if($('.SignBaseComponent-sign-box')){$('.SignBaseComponent-sign-box').remove();} if($('.AppFlow is-show')){$('.AppFlow is-show').remove();} if($('.UPlayerLotteryEnter')){$('.UPlayerLotteryEnter').remove()} if($('.layout-Player-guessgame')){$('.layout-Player-guessgame').remove();} if($('.LotteryContainer')){$('.LotteryContainer').remove();} if($('.layout-Player-announce')){$('.layout-Player-announce').remove();} if($('.layout-Player-rank')){$('.layout-Player-rank').remove();} if($('.ChatTabContainer')){$('.ChatTabContainer').remove();} if($('.closeBg-998534')){$('.closeBg-998534').remove();} if($('#js-player-toolbar')){$('#js-player-toolbar').remove();} if($('.SuperFansGuideTips')){$('.SuperFansGuideTips').remove();} if($(".Act156581")){$('.Act156581').remove();} if($('.PcDiversion')){$('.PcDiversion').remove();} if($('.HeaderGif-left')){$('.HeaderGif-left').remove();} if($('.HeaderGif-right')){$('.HeaderGif-right').remove();} if($('.Title-anchorFriend')){$('.Title-anchorFriend').remove();} if($('.SociatyLabel')){$('.SociatyLabel').remove();} if($('.Title-addFriend')){$('.Title-addFriend').remove();} if($('.ActSuperFansGroup ')){$('.ActSuperFansGroup ').remove();} if(url ==="https://www.douyu.com/directory"||url === "https://www.douyu.com/"){ //console.log(url); }else{ if($(".layout-Container").css("paddingTop")!=="0px"){$(".layout-Header").hide();$(".layout-Container").css("paddingTop","0px");} } if(e_){e_.style.top=0;} if(m_){m_.style.margin = "0px";m_.style.padding = "0px";} if(n_){n_.style.height = "110%";} if($('.Title').height()!=90){$('.Title').css("height","90px");} if($('.Title-anchorPic')){$('.Title-anchorPic').css({height:"90px",width:"90px"});} if($('.layout-Player-title').css("marginBottom")!=="0px"){$('.layout-Player-title').css("marginBottom","0px");} } },0); var str_div = (function(){/*