-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathx_script.user.js
More file actions
59 lines (51 loc) · 1.57 KB
/
Copy pathx_script.user.js
File metadata and controls
59 lines (51 loc) · 1.57 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
// ==UserScript==
// @name x 纯净版
// @namespace http://tampermonkey.net/
// @version 2024-09-25
// @description Disappear Recommended Video
// @author Villiam
// @match *://*.x.com/**
// @icon https://www.google.com/s2/favicons?sz=64&domain=bilibili.com
// @grant none
// @license MIT
// @downloadURL https://update.greasyfork.org/scripts/501560/B%E7%AB%99%E7%BA%AF%E5%87%80%E6%A8%A1%E5%BC%8F.user.js
// @updateURL https://update.greasyfork.org/scripts/501560/B%E7%AB%99%E7%BA%AF%E5%87%80%E6%A8%A1%E5%BC%8F.meta.js
// ==/UserScript==
(function () {
'use strict';
// Your code here...
function displayNone(domTag) {
const domSelector = document.querySelector(domTag);
if (domSelector) {
domSelector.style.display = 'none';
}
}
// 创建一个新的<style>元素
var style = document.createElement('style');
style.type = 'text/css';
// 定义CSS规则
var css = `
div[aria-label="时间线:你的主页时间线"] {
display: none;
}
`;
if (style.styleSheet) {
// 兼容IE的写法
style.styleSheet.cssText = css;
} else {
// 其他浏览器的写法
style.appendChild(document.createTextNode(css));
}
// 将样式应用到文档中
document.head.appendChild(style);
// home-page
// vidoe-recommend
displayNone('main.bili-feed4-layout');
// displayNone('.header-channel')
// displayNone('.header-channel-fixed')
// video-page
// vidoe-recommend-list
// displayNone('.recommend-list-v1')
// live-recommend
// displayNone('.pop-live-small-mode')
})();