// ==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