Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

merge dev to main, v4.0.9 #173

Merged
merged 8 commits into from
Nov 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# CHANGELOG

## 4.0.9

- 新增:搜索页 隐藏搜索结果中的直播
- 修复:下拉列表组件
- 更新:部分功能细节

## 4.0.8

- 修复:播放页 调节播放器宽度 Firefox页面抖动bug
Expand Down
16 changes: 16 additions & 0 deletions NOTE.md
Original file line number Diff line number Diff line change
Expand Up @@ -110,3 +110,19 @@
```
/流萤|银枝|克拉拉|寒鸦|卢卡|娜塔莎|素裳|托帕|账账|姬子|桂乃芬|虎克|艾丝妲|阮.?梅|镜流|彦卿|杰帕德|米沙|佩拉|黑塔|三月七|卡芙卡|景元|希露瓦|阿兰|停云|藿藿|布洛妮娅|丹恒|桑博|符玄|银狼|希儿|雪衣|玲可|青雀|真理医生|丹恒|饮月|瓦尔特|驭空|卡黑阮藿/
```

# UP 主昵称关键词 收集整理

昵称包含下列关键词的 UP 主绝大多数是营销号

```
今日话题
话题酱
大型纪录片
```

昵称包含下列关键词的 UP 主可能是营销号

```
黑客
```
6 changes: 3 additions & 3 deletions src/components/items/NumberComp.vue
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
</template>

<script setup lang="ts">
import { watchDebounced } from '@vueuse/core'
import { watchThrottled } from '@vueuse/core'
import { ref } from 'vue'
import { INumberItem } from '../../types/item'
import { error } from '../../utils/logger'
Expand All @@ -25,7 +25,7 @@ const item = defineProps<INumberItem>()

const currValue = ref(BiliCleanerStorage.get(item.id, item.defaultValue))

watchDebounced(
watchThrottled(
currValue,
(newValue, oldValue) => {
try {
Expand Down Expand Up @@ -59,6 +59,6 @@ watchDebounced(
error(`NumberComp ${item.id} error`, err)
}
},
{ debounce: 100 },
{ throttle: 50 },
)
</script>
6 changes: 3 additions & 3 deletions src/components/items/StringComp.vue
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
</template>

<script setup lang="ts">
import { watchDebounced } from '@vueuse/core'
import { watchThrottled } from '@vueuse/core'
import { ref } from 'vue'
import { IStringItem } from '../../types/item'
import { error } from '../../utils/logger'
Expand All @@ -23,7 +23,7 @@ const item = defineProps<IStringItem>()

const currValue = ref(BiliCleanerStorage.get(item.id, item.defaultValue))

watchDebounced(
watchThrottled(
currValue,
(newValue, oldValue) => {
try {
Expand All @@ -50,6 +50,6 @@ watchDebounced(
error(`StringComp ${item.id} error`, err)
}
},
{ debounce: 100 },
{ throttle: 50 },
)
</script>
2 changes: 1 addition & 1 deletion src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ const main = () => {
// 创建插件面板用shadowDOM节点
const wrap = document.createElement('div')
wrap.id = 'bili-cleaner'
const root = wrap.attachShadow({ mode: 'closed' })
const root = wrap.attachShadow({ mode: 'open' })
const style = document.createElement('style')
style.textContent = css
root.appendChild(style)
Expand Down
6 changes: 5 additions & 1 deletion src/modules/filters/variety/video/pages/search.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ const GM_KEYS = {
}

// 视频列表信息提取
let searchKeyword = ''
const selectorFns = {
duration: (video: HTMLElement): SelectorResult => {
const duration = video.querySelector('.bili-video-card__stats__duration')?.textContent?.trim()
Expand Down Expand Up @@ -121,7 +122,10 @@ class VideoFilterSearch implements IMainFilter {
const timer = performance.now()

// 提取元素
const selector = `.video.search-all-list .video-list > div, .search-page-video .video-list > div, .video-list-item`
const selector = `:where(.video.search-all-list, .search-page-video) .video-list > div`

// 获取搜索关键词供selectorFn使用
searchKeyword = decodeURIComponent(new URL(location.href).searchParams.get('keyword') ?? '').toLowerCase()

const videos = Array.from(this.target.querySelectorAll<HTMLElement>(selector))
if (!videos.length) {
Expand Down
7 changes: 7 additions & 0 deletions src/modules/rules/search/groups/basic.scss
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,13 @@ html[hide-search-page-activity-game-list] {
}
}

// 隐藏 搜索结果中的直播
html[hide-search-page-live-room-result] {
.video-list > div:has([href*='live.bilibili.com']) {
display: none !important;
}
}

// 隐藏 弹幕数量
html[hide-search-page-danmaku-count] {
.bili-video-card .bili-video-card__stats--left .bili-video-card__stats--item:nth-child(2) {
Expand Down
5 changes: 5 additions & 0 deletions src/modules/rules/search/groups/basic.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,11 @@ export const searchBasicItems: Item[] = [
id: 'hide-search-page-activity-game-list',
name: '隐藏 搜索结果顶部 游戏、热搜话题',
},
{
type: 'switch',
id: 'hide-search-page-live-room-result',
name: '隐藏 搜索结果中的直播',
},
{
type: 'switch',
id: 'hide-search-page-danmaku-count',
Expand Down
3 changes: 2 additions & 1 deletion vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ export default defineConfig({
userscript: {
name: 'bilibili 页面净化大师',
namespace: 'http://tampermonkey.net/',
version: '4.0.8',
version: '4.0.9',
description:
'净化 B站/哔哩哔哩 页面,支持「精简功能、播放器净化、过滤视频、过滤评论、全站黑白名单」,提供 300+ 功能,定制自己的 B 站',
author: 'festoney8',
Expand All @@ -42,6 +42,7 @@ export default defineConfig({
'*://live.bilibili.com/p/html/*',
'*://live.bilibili.com/live-room-play-game-together',
'*://www.bilibili.com/blackboard/comment-detail.html*',
'*://www.bilibili.com/blackboard/newplayer.html*',
],
icon: 'https://www.bilibili.com/favicon.ico',
'run-at': 'document-start',
Expand Down