// ==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.3 // @description 出现页面布局问题 ctrl + f5 刷新一次[更多福利关注 纯净科技公众号] // @description 公众号教程地址最初版本教程地址:https://mp.weixin.qq.com/s/H3twfD4wXZuxFjyNQMYepA // @description 斗鱼脚本功能: 自动精简斗鱼页面以及自动检测屏蔽广告等讨厌弹窗;自动发送弹幕暂时不添加;自动开启屏蔽功能 // @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/* // @match *://developer.aliyun.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() { // window 加载 window.onload = function(){ let host = document.domain; judgeFn(host,"window"); huya_barrage_closed(host); } // 文档加载后执行 $(document).ready(function(){ let host = document.domain; judgeFn(host,"document"); }); // 要移除的配置信息 var removeObject = { "www.huya.com":{ "selector":[".mod-sidebar",".room-footer",".box-crumb",".room-sidebar-hd",".player-gift-wrap",".special-bg",".hy-side",'.room-mod-ggTop','#player-login-tip-wrap'], "loadingType":"window", "css":{ ".js-responded-list":["marginLeft","10px"], ".mod-list":["width","99%"], ".mod-list":["padding","0"], ".player-ctrl-wrap":["position","unset"], ".player-ctrl-wrap":["marginTop","1px"], ".main-room":["padding","10px 0px 0"], ".main-room":["paddingLeft","8px"], ".main-wrap":["padding","55px 0 0 0"], ".main-wrap":["padding","0"], } }, "www.douyu.com":{ "selector":['.layout-Aside','#js-bottom'], "loadingType":"window" }, "fanyi.baidu.com":{ "selector":['.header','#transOtherRight','.footer'], "loadingType":"document" }, "zhuanlan.zhihu.com":{ "selector":[".Modal-wrapper",".css-1ynzxqw"], "loadingType":"document", "css":{ "html":["overflow","scroll"], } }, "developer.aliyun.com":{ "selector":[".ace-overlay-wrapper"], "loadingType":"document", "css":{ "html":["overflow","scroll"], }, } } // 公用判断执行方法 var judgeFn = (host,loading)=>{ let arr = removeObject[host]["selector"]; let loadingType = removeObject[host]["loadingType"]; let css = removeObject[host]["css"]; if(css){ for(var key in css){ $(key).css(css[key][0],css[key][1]); } } if(loadingType==loading){ perform_removal(arr); } } // 执行移除 var perform_removal = (arr)=>{ for(let i = 0;i< arr.length;i++){ if($(arr[i])){ $(arr[i]).remove(); } } } // 虎牙房间 弹幕关闭 var huya_barrage_closed=function(host){ if(host=="www.huya.com"){ if($.cookie("yyuid") == null){ window.localStorage.setItem("TT_ROOM_SHIELD_CFG_0_",'{"20001":1,"20002":1,"20003":1,"20004":1,"20005":3,"20006":0,"20007":0,"20008":0,"30000":0}'); }else{ let setName = "TT_ROOM_SHIELD_CFG_0_"+$.cookie("yyuid"); window.localStorage.setItem(setName,'{"20001":1,"20002":1,"20003":1,"20004":1,"20005":3,"20006":0,"20007":0,"20008":0,"30000":0}'); } } } 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; } //未知弹窗检测移除方法 //浏览器通知 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); } }); }**/ } var s = setInterval(function () { //定时器检测 if(window.location.host=="www.huya.com"){ if($(".shielding-effect-select").length==0){ $(".shielding-effect-btn").click(); } 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(){/*