Skip to content

Commit

Permalink
Merge pull request #3 from festoney8/dev
Browse files Browse the repository at this point in the history
merge dev to main
  • Loading branch information
festoney8 authored Dec 28, 2023
2 parents bf114cc + cd33aef commit 5c5b9e3
Show file tree
Hide file tree
Showing 5 changed files with 167 additions and 32 deletions.
4 changes: 1 addition & 3 deletions .github/workflows/dev-ci.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
name: dev-ci
on:
push:
paths:
- src
branches:
- dev

Expand All @@ -22,7 +20,7 @@ jobs:
with:
version: 8

- name: install dependencies
- name: install
run: pnpm install
- name: lint
run: pnpm run lint
Expand Down
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
# CHANGELOG

## 2.0.1

- 新增:脚本URL元数据绑定Greasyfork
- 新增:通用项 header净化支持旧版本header

## 2.0.0

- 重构:项目重构
Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,12 @@

## 安装

### **稳定版:[点此安装](https://greasyfork.org/zh-CN/scripts/479861)**
### 稳定版:[**前往 Greasyfork 安装**](https://greasyfork.org/zh-CN/scripts/479861)

- 请查看 [浏览器适配](#%E6%B5%8F%E8%A7%88%E5%99%A8%E9%80%82%E9%85%8D)
- 请查看 [**浏览器适配**](#%E6%B5%8F%E8%A7%88%E5%99%A8%E9%80%82%E9%85%8D)
- 稳定版持续在 Greasyfork 发布,油猴插件会定期检查,自动更新

### 开发测试版:[点此安装dev版](https://github.com/festoney8/bilibili-cleaner/raw/dev/dist/bilibili-cleaner.user.js)
### 测试版:[Release安装](https://github.com/festoney8/bilibili-cleaner/releases/)

## 使用

Expand Down
175 changes: 152 additions & 23 deletions src/pages/common.ts
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,13 @@ if (location.host != 'live.bilibili.com') {
false,
undefined,
false,
`div.bili-header__bar .left-entry li:has(>a[href="//www.bilibili.com"]) svg {display: none !important;}`,
`div.bili-header__bar .left-entry li:has(>a[href="//www.bilibili.com"]) svg {
display: none !important;
}
/* 旧版header */
#internationalHeader li.nav-link-item:has(>span>a[href="//www.bilibili.com"]) .navbar_logo {
display: none !important;
}`,
),
)
// 隐藏 顶栏-首页
Expand All @@ -137,8 +143,20 @@ if (location.host != 'live.bilibili.com') {
false,
undefined,
false,
`div.bili-header__bar li:has(>a[href="//www.bilibili.com"]) span {display: none !important;}
div.bili-header__bar .left-entry .v-popover-wrap:has(>a[href="//www.bilibili.com"]) div {display: none !important;}`,
`div.bili-header__bar li:has(>a[href="//www.bilibili.com"]) span {
display: none !important;
}
div.bili-header__bar .left-entry .v-popover-wrap:has(>a[href="//www.bilibili.com"]) div {
display: none !important;
}
/* 旧版header */
#internationalHeader li.nav-link-item:has(>span>a[href="//www.bilibili.com"]) :not(svg) {
color: transparent;
user-select: none;
}
#internationalHeader li.nav-link-item:has(>span>a[href="//www.bilibili.com"]) .navbar_pullup {
display: none !important;
}`,
),
)
// 隐藏 顶栏-番剧
Expand All @@ -149,7 +167,13 @@ if (location.host != 'live.bilibili.com') {
false,
undefined,
false,
`div.bili-header__bar .left-entry li:has(>a[href="//www.bilibili.com/anime/"]) {display: none !important;}`,
`div.bili-header__bar .left-entry li:has(>a[href="//www.bilibili.com/anime/"]) {
display: none !important;
}
/* 旧版header */
#internationalHeader li.nav-link-item:has(>a[href*="bilibili.com/anime"]) {
display: none !important;
}`,
),
)
// 隐藏 顶栏-直播
Expand All @@ -160,7 +184,13 @@ if (location.host != 'live.bilibili.com') {
false,
undefined,
false,
`div.bili-header__bar .left-entry li:has(>a[href="//live.bilibili.com"]) {display: none !important;}`,
`div.bili-header__bar .left-entry li:has(>a[href="//live.bilibili.com"]) {
display: none !important;
}
/* 旧版header */
#internationalHeader li.nav-link-item:has(>span>a[href*="live.bilibili.com"]) {
display: none !important;
}`,
),
)
// 隐藏 顶栏-游戏中心
Expand All @@ -171,7 +201,13 @@ if (location.host != 'live.bilibili.com') {
false,
undefined,
false,
`div.bili-header__bar .left-entry li:has(>a[href^="//game.bilibili.com"]) {display: none !important;}`,
`div.bili-header__bar .left-entry li:has(>a[href^="//game.bilibili.com"]) {
display: none !important;
}
/* 旧版header */
#internationalHeader li.nav-link-item:has(>span>a[href*="game.bilibili.com"]) {
display: none !important;
}`,
),
)
// 隐藏 顶栏-会员购
Expand All @@ -182,7 +218,13 @@ if (location.host != 'live.bilibili.com') {
false,
undefined,
false,
`div.bili-header__bar .left-entry li:has(>a[href^="//show.bilibili.com"]) {display: none !important;}`,
`div.bili-header__bar .left-entry li:has(>a[href^="//show.bilibili.com"]) {
display: none !important;
}
/* 旧版header */
#internationalHeader li.nav-link-item:has(>a[href*="show.bilibili.com"]) {
display: none !important;
}`,
),
)
// 隐藏 顶栏-漫画
Expand All @@ -193,7 +235,13 @@ if (location.host != 'live.bilibili.com') {
false,
undefined,
false,
`div.bili-header__bar .left-entry li:has(>a[href^="//manga.bilibili.com"]) {display: none !important;}`,
`div.bili-header__bar .left-entry li:has(>a[href^="//manga.bilibili.com"]) {
display: none !important;
}
/* 旧版header */
#internationalHeader li.nav-link-item:has(>span>a[href*="manga.bilibili.com"]) {
display: none !important;
}`,
),
)
// 隐藏 顶栏-赛事
Expand All @@ -206,6 +254,10 @@ if (location.host != 'live.bilibili.com') {
false,
`div.bili-header__bar .left-entry li:has(>a[href^="//www.bilibili.com/match/"], >a[href^="//www.bilibili.com/v/game/match/"]) {
display: none !important;
}
/* 旧版header */
#internationalHeader li.nav-link-item:has(>a[href*="bilibili.com/match/"]) {
display: none !important;
}`,
),
)
Expand All @@ -217,9 +269,18 @@ if (location.host != 'live.bilibili.com') {
false,
undefined,
false,
`div.bili-header__bar li:has(.loc-mc-box) {display: none !important;}
`div.bili-header__bar li:has(.loc-mc-box) {
display: none !important;
}
div.bili-header__bar .left-entry li:not(:has(.v-popover)):has([href^="https://live.bilibili.com/"]) {
display: none !important;
}
/* 旧版header */
#internationalHeader li.nav-link-item:has(a[href*="live.bilibili.com/blackboard"]) {
display: none !important;
}
#internationalHeader li.nav-link-item:has(.loc-mc-box, [href^="https://live.bilibili.com/"]) {
display: none !important;
}`,
),
)
Expand All @@ -242,7 +303,13 @@ if (location.host != 'live.bilibili.com') {
true,
undefined,
false,
`div.bili-header__bar .left-entry li:has(a[href="//app.bilibili.com"]) {display: none !important;}`,
`div.bili-header__bar .left-entry li:has(a[href="//app.bilibili.com"]) {
display: none !important;
}
/* 旧版header */
#internationalHeader li.nav-link-item:has(a[href="//app.bilibili.com"]) {
display: none !important;
}`,
),
)
// 隐藏 顶栏-所有官方活动(blackboard)
Expand All @@ -253,8 +320,16 @@ if (location.host != 'live.bilibili.com') {
false,
undefined,
false,
`div.bili-header__bar .left-entry li:has(>a[href*="bilibili.com/blackboard"]) {display: none !important;}
div.bili-header__bar .left-entry li:has(>div>a[href*="bilibili.com/blackboard"]) {display: none !important;}`,
`div.bili-header__bar .left-entry li:has(>a[href*="bilibili.com/blackboard"]) {
display: none !important;
}
div.bili-header__bar .left-entry li:has(>div>a[href*="bilibili.com/blackboard"]) {
display: none !important;
}
/* 旧版header */
#internationalHeader li.nav-link-item:has(.loc-mc-box, span>a[href*="bilibili.com/blackboard"]) {
display: none !important;
}`,
),
)
}
Expand All @@ -270,7 +345,9 @@ if (location.host != 'live.bilibili.com') {
false,
undefined,
false,
`#nav-searchform .nav-search-input::placeholder {color: transparent;}`,
`#nav-searchform .nav-search-input::placeholder {color: transparent;}
/* 旧版header */
#internationalHeader #nav_searchform input::placeholder {color: transparent;}`,
),
)
// 隐藏 顶栏-搜索框 搜索历史
Expand All @@ -281,7 +358,9 @@ if (location.host != 'live.bilibili.com') {
false,
undefined,
false,
`.search-panel .history {display: none;}`,
`.search-panel .history {display: none;}
/* 旧版header */
#internationalHeader .nav-search-box .history {display: none !important;}`,
),
)
// 隐藏 顶栏-搜索框 bilibili热搜
Expand All @@ -292,7 +371,9 @@ if (location.host != 'live.bilibili.com') {
false,
undefined,
false,
`.search-panel .trending {display: none;}`,
`.search-panel .trending {display: none;}
/* 旧版header */
#internationalHeader .nav-search-box .trending {display: none !important;}`,
),
)
}
Expand All @@ -308,7 +389,13 @@ if (location.host != 'live.bilibili.com') {
false,
undefined,
false,
`.right-entry .v-popover-wrap.header-avatar-wrap {display: none !important;}`,
`.right-entry .v-popover-wrap.header-avatar-wrap {
display: none !important;
}
/* 旧版header */
#internationalHeader .nav-user-center .item:has(.mini-avatar) {
display: none !important;
}`,
),
)
// 隐藏 顶栏-大会员, 默认开启
Expand All @@ -319,7 +406,13 @@ if (location.host != 'live.bilibili.com') {
true,
undefined,
false,
`.right-entry .vip-wrap:has([href="//account.bilibili.com/big"]) {display: none !important;}`,
`.right-entry .vip-wrap:has([href="//account.bilibili.com/big"]) {
display: none !important;
}
/* 旧版header */
#internationalHeader .nav-user-center .item:has(.mini-vip) {
display: none !important;
}`,
),
)
// 隐藏 顶栏-消息
Expand All @@ -330,7 +423,13 @@ if (location.host != 'live.bilibili.com') {
false,
undefined,
false,
`.right-entry .v-popover-wrap:has([href^="//message.bilibili.com"], [data-idx="message"]) {display: none !important;}`,
`.right-entry .v-popover-wrap:has([href^="//message.bilibili.com"], [data-idx="message"]) {
display: none !important;
}
/* 旧版header */
#internationalHeader .nav-user-center .item:has(.nav-item-message) {
display: none !important;
}`,
),
)
// 隐藏 顶栏-动态
Expand All @@ -341,7 +440,13 @@ if (location.host != 'live.bilibili.com') {
false,
undefined,
false,
`.right-entry .v-popover-wrap:has([href^="//t.bilibili.com"], [data-idx="dynamic"]) {display: none !important;}`,
`.right-entry .v-popover-wrap:has([href^="//t.bilibili.com"], [data-idx="dynamic"]) {
display: none !important;
}
/* 旧版header */
#internationalHeader .nav-user-center .item:has(.nav-item-dynamic) {
display: none !important;
}`,
),
)
// 隐藏 顶栏-收藏
Expand All @@ -352,7 +457,13 @@ if (location.host != 'live.bilibili.com') {
false,
undefined,
false,
`.right-entry .v-popover-wrap:has(.header-favorite-container, [data-idx="fav"]) {display: none !important;}`,
`.right-entry .v-popover-wrap:has(.header-favorite-container, [data-idx="fav"]) {
display: none !important;
}
/* 旧版header */
#internationalHeader .nav-user-center .item:has(.mini-favorite) {
display: none !important;
}`,
),
)
// 隐藏 顶栏-历史
Expand All @@ -363,7 +474,13 @@ if (location.host != 'live.bilibili.com') {
false,
undefined,
false,
`.right-entry .v-popover-wrap:has([href="//www.bilibili.com/account/history"], [data-idx="history"]) {display: none !important;}`,
`.right-entry .v-popover-wrap:has([href="//www.bilibili.com/account/history"], [data-idx="history"]) {
display: none !important;
}
/* 旧版header */
#internationalHeader .nav-user-center .item:has(.mini-history) {
display: none !important;
}`,
),
)
// 隐藏 顶栏-创作中心
Expand All @@ -374,7 +491,13 @@ if (location.host != 'live.bilibili.com') {
false,
undefined,
false,
`.right-entry .right-entry-item:has(a[href="//member.bilibili.com/platform/home"], [data-idx="creation"]) {display: none !important;}`,
`.right-entry .right-entry-item:has(a[href="//member.bilibili.com/platform/home"], [data-idx="creation"]) {
display: none !important;
}
/* 旧版header */
#internationalHeader .nav-user-center .item:has(a[href="//member.bilibili.com/platform/home"]) {
display: none !important;
}`,
),
)
// 隐藏 顶栏-投稿
Expand All @@ -386,7 +509,13 @@ if (location.host != 'live.bilibili.com') {
undefined,
false,
// 不可设定 display: none, 会导致历史和收藏popover显示不全
`.right-entry .right-entry-item.right-entry-item--upload {visibility: hidden !important;}`,
`.right-entry .right-entry-item.right-entry-item--upload {
visibility: hidden !important;
}
/* 旧版header */
#internationalHeader .nav-user-center >div:has(.mini-upload) {
visibility: hidden !important;
}`,
),
)
}
Expand Down
Loading

0 comments on commit 5c5b9e3

Please sign in to comment.