// ==UserScript== // @name 安静看B站bilibili // @namespace http://tampermonkey.net/ // @version 0.11 // @description 我可以用APP但你不能强制我用APP打开 // @author soundEgg // @match https://m.bilibili.com/video/* // @match https://m.bilibili.com/space/* // @grant none // @downloadURL none // ==/UserScript== (function() { 'use strict'; var root = window.location.href; if(root.indexOf('/video/')>-1){ // Your code here... // 我可以用APP但你不能强制我APP打开 //清除APP打开 var arr=document.querySelectorAll('.open-app');arr.forEach(function (item) { if(item){ item.remove(); } }); //清除class属性 var arr2=document.querySelectorAll('.open-app-btn.v-card-toapp'); arr2.forEach(function (item) { if(item){ item.setAttribute("class", "v-card-toapp") } }); //清除原有点击,重新插入 var t = document.querySelector('.video-list').getInnerHTML(); var obj = document.getElementsByClassName("video-list")[0]; document.getElementsByClassName("card-box")[0].remove() obj.insertAdjacentHTML("afterBegin",t); //增加点击事件*转换 var arr3=document.querySelectorAll('.v-card-toapp'); arr3.forEach(function (item) { if(item){ var aid=item.dataset.aid; item.addEventListener('click', function(){ window.location.href="https://m.bilibili.com/video/av"+aid; }) } }); //移除APP打开高清又流畅标题 document.getElementsByClassName("open-app-btn m-video-main-openapp visible-open-app-btn")[0].remove() } else if(root.indexOf('/space/')>-1){ document.getElementsByClassName("open-app-btn m-space-float-openapp")[0].remove() } })();