解决投币、收藏无弹窗的问题关于屏蔽B站的成为大会员解锁所有清晰度


// ==UserScript== // @name 屏蔽B站的成为大会员解锁所有清晰度2.0 // @namespace http://tampermonkey.net/ // @version 0.2 // @description 很简单的设置弹窗的显示样式为None,然后监听到点击三连栏去掉这个样式允许弹窗 // @author 蓝若魔改(不是,参考博客https://www.cnblogs.com/2944014083-zhiyu/p/14911242.html // @match https://www.bilibili.com/video/* // @grant unsafeWindow // ==/UserScript== (function() { 'use strict'; // Your code here... // 获取元素 var play11=document.querySelector(".bilibili-player-video-state"); console.log(play11); const style = document.createElement("style"); //设置弹窗的显示方式:不显示 style.innerHTML = `.bili-dialog-m {display: none !important;}`; //给它加一个id方便后面去掉 style.id='biliByLanr'; document.head.appendChild(style); //设置点击监听:点击三连(雾)栏一整条,点哪都弹窗允许显示投币收藏 //document.getElementById('arc_toolbar_report').addEventListener('click', function() { document.head.removeChild(document.getElementById('biliByLanr'));}, false); //只监听投币和收藏 document.querySelector('.coin').addEventListener('click', function() { document.head.removeChild(document.getElementById('biliByLanr'));}, false); document.querySelector('.collect').addEventListener('click', function() { document.head.removeChild(document.getElementById('biliByLanr'));}, false); //播放视频,清除暂停 var timer = setInterval(xunhuan, 100); var jishu=0; var lanr=0; function xunhuan(){ if (document.querySelector(".video-state-pause")!=null){ play11.click(); console.log(play11); lanr+=1; //捕获到3次暂停,解除禁止暂停,黑屏加载的时候不要瞎点,会算次数进去的... if(lanr>2){clearInterval(timer);} }else{ jishu++; //如果连续播放了5秒就解除禁止暂停 if(jishu>50){ clearInterval(timer); } } } })();

 

可以简单的把这个全选覆盖到原来的版本。思路都写到注释了。  

我问了一下同伴,好像只有大会员断续的人有这个弹窗,流汗黄豆.jpg

posted @ 2021-08-25 17:31  dearmosy  阅读(568)  评论(1)    收藏  举报