B站纯净版
关掉了推荐视频,防止自己打开了B站被分心, 可以专心去搜索想看的学习视频
代码实现很简单, 但很实用
2024.07.23 更新
看了下大家的评论, 有个大佬的思路太棒了, 因此简单更新一版本
有老哥说不是很会用的, 很抱歉, 这怕要自己去搜索一下怎么贴油猴脚本了
// ==UserScript==
// home.php?mod=space&uid=170990 B站纯净模式
// home.php?mod=space&uid=467642 http://tampermonkey.net/
// home.php?mod=space&uid=1248337 2024-07-23
// @description display none Recommended Video
// home.php?mod=space&uid=686208 You
// home.php?mod=space&uid=195849 *://www.bilibili.com/**
// home.php?mod=space&uid=593100 https://www.google.com/s2/favicons?sz=64&domain=bilibili.com
// home.php?mod=space&uid=609072 none
// ==/UserScript==
(function() {
'use strict';
// Your code here...
// @Deprecated
function displayNone(domTag) {
const domSelector = document.querySelector(domTag)
if(domSelector) {
domSelector.style.display = 'none'
}
}
// @Deprecated
function delayDisappear(domTag) {
setTimeout(()=> {
displayNone(domTag)
}, 3000)
}
// 创建一个新的<style>元素
var style = document.createElement('style');
style.type = 'text/css';
// 定义CSS规则
var css = `
/* 下课客户端入口 */
.download-entry,
/* 首页推荐 */
main.bili-feed4-layout,
/* 顶部推荐 */
.header-channel,
.header-channel-fixed,
/* 推荐视频 */
.recommend-list-v1,
/* 直播间推荐 */
.pop-live-small-mode {
display: none!important;
}
`;
if (style.styleSheet) {
// 兼容IE的写法
style.styleSheet.cssText = css;
} else {
// 其他浏览器的写法
style.appendChild(document.createTextNode(css));
}
// 将样式应用到文档中
document.head.appendChild(style);
})();
扫码免费获取资源:
