Merge branch 'preview-fixes'

This commit is contained in:
the1812 2025-09-11 09:36:09 +08:00
commit f8d9b5665f
18 changed files with 175 additions and 56 deletions

View File

@ -1,6 +1,36 @@
<!-- spell-checker: disable -->
# 更新日志
## v2.10.4-preview
`2025-09-11`
包含 [v2.10.4](https://github.com/the1812/Bilibili-Evolved/releases/tag/v2.10.4) 的所有更新内容.
✨新增
- 新增组件 `定制自动连播行为`, 可根据自动连播视频类型分别配置. (PR #5303 by [wsgh0202](https://github.com/wsgh0202))
- `网址参数清理` 新增选项 `清理页面中的 A 标签`. (PR #5339 by [WakelessSloth56](https://github.com/WakelessSloth56), [LainIO24](https://github.com/lainio24))
- `保存视频元数据` 支持标签和番剧信息, 支持番剧OPED转换为章节. (PR #5355 by [WakelessSloth56](https://github.com/WakelessSloth56), [LainIO24](https://github.com/lainio24))
- 新增组件 `替换标题党封面`, 可将视频卡片的封面替换为视频预览帧. (PR #5226 by [UcnacDx2](https://github.com/UcnacDx2))
- 新增组件 `会员购链接转换`, 可将移动端的会员购链接转换为 PC 端的链接. (#5310)
- `下载视频` 支持配置下载地址偏好. (#3234)
- 搜索栏支持自动补全关键词和搜索历史. (#822)
## v2.10.4
`2025-09-11`
✨新增
- `隐藏用户信息卡片` 适配新版评论区. (#5324, PR #5327 by [WakelessSloth56](https://github.com/WakelessSloth56))
🐛修复
- 修复 `隐藏首页轮播图` 失效. (PR #5287 by [wsgh0202](https://github.com/wsgh0202))
- 修复 `删除广告` 在首页无法屏蔽部分广告, 新增移除占位的选项. (PR #5307, #5309 by [wsgh0202](https://github.com/wsgh0202))
- 修复部分功能未能识别主站分区页面的问题.
- 修复 `下载表情` 失效. (#5320, PR #5325 by [Pencil](https://github.com/pencilqaq))
- 修复 `点亮粉丝勋章` 在原版直播间失效. (PR #5328 by [k](https://github.com/kkkkkkkk566))
- 修复 `清爽首页` 中的国创分区内容显示错误. (#5292)
- 修复 `评论内容替换` 在 Firefox 中不生效. (#4843)
- `夜间模式` 排除商家平台 (`shop.bilibili.com`). (PR #5354 by [ImAyxs](https://github.com/Ayx03))
## v2.10.3-preview
`2025-07-22`

View File

@ -30,6 +30,9 @@ https://afdian.com/a/the1812?tab=sponsor
| 时间 | 用户名 | 单号后4位 | 金额 |
| ------------------- | --------------------- | --------- | ------- |
| 2025.09.03 03:46:27 | j*c | 0452 | ¥10.00 |
| 2025.08.13 12:45:58 | *餮 | 9658 | ¥5.00 |
| 2025.07.23 19:29:44 | 匿名 | 3850 | ¥23.33 |
| 2025.07.12 16:44:24 | 爱音allin | 3957 | ¥5.00 |
| 2025.06.29 10:53:44 | f*x | 9352 | ¥10.00 |
| 2025.06.10 01:22:23 | *匆 | 5332 | ¥5.00 |

View File

@ -315,7 +315,7 @@
"type": "component",
"name": "hideHomeCarousel",
"displayName": "隐藏首页轮播图",
"description": "隐藏首页的轮播图区域.\r\n",
"description": "隐藏首页的轮播图区域\r\n\r\n选项说明\r\n\r\n- `禁用轮播`:禁用图片轮播,可以手动切换\r\n- `图片模糊`模糊轮播图片为0时不模糊\r\n- `样式开关`\r\n - `隐藏轮播区域占位`:完全隐藏整个轮播区域\r\n - `透明化轮播区域`:完全透明化整个轮播区域,同时禁止点击打开链接\r\n - `隐藏轮播图片`:隐藏轮播图片,同时禁止点击图片打开链接\r\n - `隐藏图片标题`:隐藏图片标题,同时禁止点击标题打开链接\r\n\r\n > 注:样式开关可以同时启用,但是最终显示效果以作用范围大的为准 \r\n > 例如启用 `隐藏轮播区域占位`,由于整个区域都被隐藏,不管 `隐藏轮播图片`、`隐藏图片标题` 等选项是否启用都已经看不见了\r\n",
"fullRelativePath": "../../registry/dist/components/style/hide/home-carousel.js",
"fullAbsolutePath": "registry/dist/components/style/hide/home-carousel.js"
},
@ -667,7 +667,7 @@
"type": "component",
"name": "removePromotions",
"displayName": "删除广告",
"description": "删除站内的各种广告. 包括首页的推广模块, 手机 app 推荐, 视频页面右侧的广告等. 注意: 首页推广模块删除后留下空白区域是正常现象, 如果觉得怪可以开启 \\`占位文本\\` 选项.\r\n\r\n- \\`占位文本\\`: 删除首页推广模块的广告后显示\"🚫已屏蔽广告\"来替代空白区域.\r\n- \\`保留活动横幅\\`: 保留视频页面的活动横幅.\r\n",
"description": "删除站内的各种广告. 包括首页的推广模块, 手机 app 推荐, 视频页面右侧的广告等.\r\n\r\n- `保留活动横幅`: 保留视频页面的活动横幅.\r\n- `选项`\r\n - `卡片占位`: 关闭时广告卡片将完全隐藏,后续的视频卡片会自动补上空缺位置\r\n - `占位文本`: 屏蔽首页推广模块的广告后显示\"🚫已屏蔽广告\"来替代空白区域.\r\n - `调试模式`: 用于查看是否正确屏蔽广告,启用时将边框高亮广告卡片,同时其他屏蔽选项会失效\r\n",
"fullRelativePath": "../../registry/dist/components/utils/remove-promotions.js",
"fullAbsolutePath": "registry/dist/components/utils/remove-promotions.js"
},

View File

@ -416,7 +416,20 @@ by [@Tinhone](https://github.com/Tinhone)
**GitHub:** [`Stable`](https://raw.githubusercontent.com/the1812/Bilibili-Evolved/master/registry/dist/components/style/hide/home-carousel.js) / [`Preview`](https://raw.githubusercontent.com/the1812/Bilibili-Evolved/preview/registry/dist/components/style/hide/home-carousel.js)
隐藏首页的轮播图区域.
隐藏首页的轮播图区域
选项说明:
- `禁用轮播`:禁用图片轮播,可以手动切换
- `图片模糊`模糊轮播图片为0时不模糊
- `样式开关`
- `隐藏轮播区域占位`:完全隐藏整个轮播区域
- `透明化轮播区域`:完全透明化整个轮播区域,同时禁止点击打开链接
- `隐藏轮播图片`:隐藏轮播图片,同时禁止点击图片打开链接
- `隐藏图片标题`:隐藏图片标题,同时禁止点击标题打开链接
> 注:样式开关可以同时启用,但是最终显示效果以作用范围大的为准
> 例如启用 `隐藏轮播区域占位`,由于整个区域都被隐藏,不管 `隐藏轮播图片`、`隐藏图片标题` 等选项是否启用都已经看不见了
### [隐藏热搜](../../registry/dist/components/style/hide/trending-search.js)
`hideTrendingSearch`
@ -934,10 +947,13 @@ by [@Light_Quanta](https://github.com/LightQuanta)
**GitHub:** [`Stable`](https://raw.githubusercontent.com/the1812/Bilibili-Evolved/master/registry/dist/components/utils/remove-promotions.js) / [`Preview`](https://raw.githubusercontent.com/the1812/Bilibili-Evolved/preview/registry/dist/components/utils/remove-promotions.js)
删除站内的各种广告. 包括首页的推广模块, 手机 app 推荐, 视频页面右侧的广告等. 注意: 首页推广模块删除后留下空白区域是正常现象, 如果觉得怪可以开启 \`占位文本\` 选项.
删除站内的各种广告. 包括首页的推广模块, 手机 app 推荐, 视频页面右侧的广告等.
- \`占位文本\`: 删除首页推广模块的广告后显示"🚫已屏蔽广告"来替代空白区域.
- \`保留活动横幅\`: 保留视频页面的活动横幅.
- `保留活动横幅`: 保留视频页面的活动横幅.
- `选项`
- `卡片占位`: 关闭时广告卡片将完全隐藏,后续的视频卡片会自动补上空缺位置
- `占位文本`: 屏蔽首页推广模块的广告后显示"🚫已屏蔽广告"来替代空白区域.
- `调试模式`: 用于查看是否正确屏蔽广告,启用时将边框高亮广告卡片,同时其他屏蔽选项会失效
### [关注时间显示](../../registry/dist/components/utils/subscribe-time-show.js)
`subscribeTimeShow`

View File

@ -20,7 +20,7 @@
"type": "component",
"name": "removePromotions",
"displayName": "删除广告",
"description": "删除站内的各种广告. 包括首页的推广模块, 手机 app 推荐, 视频页面右侧的广告等. 注意: 首页推广模块删除后留下空白区域是正常现象, 如果觉得怪可以开启 \\`占位文本\\` 选项.\r\n\r\n- \\`占位文本\\`: 删除首页推广模块的广告后显示\"🚫已屏蔽广告\"来替代空白区域.\r\n- \\`保留活动横幅\\`: 保留视频页面的活动横幅.\r\n",
"description": "删除站内的各种广告. 包括首页的推广模块, 手机 app 推荐, 视频页面右侧的广告等.\r\n\r\n- `保留活动横幅`: 保留视频页面的活动横幅.\r\n- `选项`\r\n - `卡片占位`: 关闭时广告卡片将完全隐藏,后续的视频卡片会自动补上空缺位置\r\n - `占位文本`: 屏蔽首页推广模块的广告后显示\"🚫已屏蔽广告\"来替代空白区域.\r\n - `调试模式`: 用于查看是否正确屏蔽广告,启用时将边框高亮广告卡片,同时其他屏蔽选项会失效\r\n",
"fullRelativePath": "../../registry/dist/components/utils/remove-promotions.js",
"fullAbsolutePath": "registry/dist/components/utils/remove-promotions.js"
},
@ -191,7 +191,7 @@
"type": "component",
"name": "removePromotions",
"displayName": "删除广告",
"description": "删除站内的各种广告. 包括首页的推广模块, 手机 app 推荐, 视频页面右侧的广告等. 注意: 首页推广模块删除后留下空白区域是正常现象, 如果觉得怪可以开启 \\`占位文本\\` 选项.\r\n\r\n- \\`占位文本\\`: 删除首页推广模块的广告后显示\"🚫已屏蔽广告\"来替代空白区域.\r\n- \\`保留活动横幅\\`: 保留视频页面的活动横幅.\r\n",
"description": "删除站内的各种广告. 包括首页的推广模块, 手机 app 推荐, 视频页面右侧的广告等.\r\n\r\n- `保留活动横幅`: 保留视频页面的活动横幅.\r\n- `选项`\r\n - `卡片占位`: 关闭时广告卡片将完全隐藏,后续的视频卡片会自动补上空缺位置\r\n - `占位文本`: 屏蔽首页推广模块的广告后显示\"🚫已屏蔽广告\"来替代空白区域.\r\n - `调试模式`: 用于查看是否正确屏蔽广告,启用时将边框高亮广告卡片,同时其他屏蔽选项会失效\r\n",
"fullRelativePath": "../../registry/dist/components/utils/remove-promotions.js",
"fullAbsolutePath": "registry/dist/components/utils/remove-promotions.js"
},

View File

@ -1,5 +1,6 @@
import { defineComponentMetadata } from '@/components/define'
import { getUID } from '@/core/utils'
import { liveUrls } from '@/core/utils/urls'
export const component = defineComponentMetadata({
name: 'badgeKeepalive',
@ -16,5 +17,5 @@ export const component = defineComponentMetadata({
component: () => import('./BadgeKeepalive.vue').then(m => m.default),
condition: () => Boolean(getUID()),
},
urlInclude: ['//live.bilibili.com'],
urlInclude: liveUrls,
})

View File

@ -3,7 +3,11 @@ import { getCsrf, getUID } from '@/core/utils'
// 获取当前直播间号
export function getLiveRoomId(): string {
const matched = location.href.match(/live.bilibili.com\/(\d+)/)
let matched = location.href.match(/live.bilibili.com\/(\d+)/)
if (matched) {
return matched[1]
}
matched = location.href.match(/live.bilibili.com\/blanc\/(\d+)/)
return matched ? matched[1] : ''
}

View File

@ -1,5 +1,6 @@
.user-card,
.user-card-m-exp,
.bili-user-profile {
.bili-user-profile,
bili-user-profile {
display: none !important;
}

View File

@ -33,8 +33,8 @@ export const compactRankListCssVars = {
export const PGCSeasonTypeMap = {
anime: 1,
movie: 2,
guochuang: 3,
documentary: 4,
documentary: 3,
guochuang: 4,
tv: 5,
}
export const getDefaultRankListCards = (json: any): RankListCard[] => {

View File

@ -1,7 +1,7 @@
import type { CommentItem } from '@/components/utils/comment-apis'
import { CommentReplyItem } from '@/components/utils/comment/reply-item'
export interface CommentContentReplaceContext {
commentItem: CommentItem
commentItem: CommentReplyItem
content: Node[]
}
export type CommentContentReplaceHandler = (

View File

@ -1,6 +1,6 @@
import { defineComponentMetadata } from '@/components/define'
import { forEachCommentItem } from '@/components/utils/comment-apis'
import { select } from '@/core/spin-query'
import { CommentReplyItem, forEachCommentItem } from '@/components/utils/comment-apis'
import { sq } from '@/core/spin-query'
import { getData } from '@/plugins/data'
import type { CommentContentReplaceHandler } from './handlers/types'
import { commentContentReplaceOptions } from './options'
@ -14,21 +14,33 @@ export const component = defineComponentMetadata({
forEachCommentItem({
added: async commentItem => {
const { CommentContentReplaceHandlers } = await import('./handlers')
if (commentItem.shadowDomEntry === undefined) {
return
const replaceContent = async (item: CommentReplyItem) => {
if (item.shadowDomEntry === undefined) {
return
}
const content = await sq(
() => item.shadowDomEntry.querySelector(':host(bili-rich-text) #contents'),
contents => contents.childNodes.length > 0,
{ queryInterval: 100 },
)
if (content === null) {
return
}
const [handlers] = getData(CommentContentReplaceHandlers) as [
CommentContentReplaceHandler[],
]
handlers.forEach(h => h({ commentItem: item, content: Array.from(content.childNodes) }))
}
const content = await select(
() => commentItem.shadowDomEntry.querySelector(':host(bili-rich-text) #contents'),
{ queryInterval: 200 },
)
if (content === null) {
return
}
content.childNodes
const [handlers] = getData(CommentContentReplaceHandlers) as [
CommentContentReplaceHandler[],
]
handlers.forEach(h => h({ commentItem, content: Array.from(content.childNodes) }))
await replaceContent(commentItem)
commentItem.replies.forEach(reply => {
replaceContent(reply)
})
commentItem.addEventListener('repliesUpdate', e => {
const replies = (e as CustomEvent).detail as CommentReplyItem[]
replies.forEach(reply => {
replaceContent(reply)
})
})
},
})
},

View File

@ -23,8 +23,7 @@ export default Vue.extend({
data() {
return {
downloading: false,
midRegex: /mid=(\d+)/,
roomIdRegex: /^https:\/\/live\.bilibili\.com\/(\d+)(?:\?.*)?$/,
roomIdRegex: /^https:\/\/live\.bilibili\.com\/(?:blanc\/)?(\d+)(?:\?\.*?)?$/,
}
},
methods: {

View File

@ -1,4 +1,5 @@
import { defineComponentMetadata } from '@/components/define'
import { liveUrls } from '@/core/utils/urls'
export const component = defineComponentMetadata({
name: 'downloadEmoticons',
@ -12,5 +13,5 @@ export const component = defineComponentMetadata({
widget: {
component: () => import('./Widget.vue').then(m => m.default),
},
urlInclude: [/^https:\/\/live\.bilibili\.com\/(\d+)/],
urlInclude: liveUrls,
})

View File

@ -1,4 +1,7 @@
删除站内的各种广告. 包括首页的推广模块, 手机 app 推荐, 视频页面右侧的广告等. 注意: 首页推广模块删除后留下空白区域是正常现象, 如果觉得怪可以开启 \`占位文本\` 选项.
删除站内的各种广告. 包括首页的推广模块, 手机 app 推荐, 视频页面右侧的广告等.
- \`占位文本\`: 删除首页推广模块的广告后显示"🚫已屏蔽广告"来替代空白区域.
- \`保留活动横幅\`: 保留视频页面的活动横幅.
- `保留活动横幅`: 保留视频页面的活动横幅.
- `选项`
- `卡片占位`: 关闭时广告卡片将完全隐藏,后续的视频卡片会自动补上空缺位置
- `占位文本`: 屏蔽首页推广模块的广告后显示"🚫已屏蔽广告"来替代空白区域.
- `调试模式`: 用于查看是否正确屏蔽广告,启用时将边框高亮广告卡片,同时其他屏蔽选项会失效

View File

@ -1,5 +1,5 @@
import { ComponentEntry } from '@/components/types'
import { defineComponentMetadata } from '@/components/define'
import { wrapSwitchOptions } from '@/components/switch-options'
// const PromotionMark = 'data-be-promotion-mark'
const entry: ComponentEntry = async ({ settings, metadata }) => {
@ -81,15 +81,24 @@ const entry: ComponentEntry = async ({ settings, metadata }) => {
},
true,
)
addComponentListener(
`${metadata.name}.showPlaceholder`,
(value: boolean) => {
document.body.classList.toggle('promotion-show-placeholder', value)
},
true,
)
}
export const component = defineComponentMetadata({
export const component = wrapSwitchOptions({
name: 'removePromotionOptions',
switches: {
showContainer: {
displayName: '卡片占位',
defaultValue: true,
},
showPlaceholder: {
displayName: '占位文本',
defaultValue: true,
},
debug: {
displayName: '调试模式',
defaultValue: false,
},
},
})({
name: 'removePromotions',
displayName: '删除广告',
entry,
@ -101,10 +110,6 @@ export const component = defineComponentMetadata({
],
tags: [componentsTags.utils],
options: {
showPlaceholder: {
displayName: '占位文本',
defaultValue: true,
},
preserveEventBanner: {
displayName: '保留活动横幅',
defaultValue: false,

View File

@ -90,9 +90,52 @@ body.dark .blocked-ads.new {
body:not(.preserve-feed-goods) .bili-dyn-content__orig__additional:has(.dyn-goods) {
margin: 0 !important;
}
.feed-card:has(.bili-video-card a[href*='cm.bilibili.com']),
.bili-video-card.is-rcmd:has(a[href*='cm.bilibili.com']),
.bili-video-card__wrap:has(a[href*='cm.bilibili.com']),
body:not(.promotion-show-placeholder) :is(.bili-video-card.is-rcmd, .bili-feed4-layout .feed-card):not(:has(.bili-video-card__wrap)) {
display: none !important;
// switch类型选项类名前缀
$switchPrefix: 'removePromotions-switch';
// 首页广告推广
.container > :is(.feed-card, .bili-feed-card):has(.bili-video-card__stats > :is(.bili-video-card__stats--text, svg)),
.container > :is(.feed-card, .bili-feed-card):has(.bili-video-card__info--tit > a:not([href])),
// 视频搜索页广告
.video-list-item:has(.bili-video-card__info--ad) {
visibility: hidden;
pointer-events: none !important;
// 占位文本
& .bili-video-card__image::after {
@extend .blocked-ads;
content: '🚫已屏蔽广告';
width: 100%;
height: 100%;
position: absolute;
top: 0;
user-select: none;
visibility: hidden;
border-radius: 6px;
background-color: #eee;
body.dark & {
background-color: #333;
}
body.#{$switchPrefix}-showPlaceholder & {
visibility: visible;
}
body.#{$switchPrefix}-debug & {
visibility: hidden !important;
}
}
body:not(.#{$switchPrefix}-showContainer) & {
display: none;
}
body.#{$switchPrefix}-debug & {
display: unset;
visibility: visible;
border: red 1px solid;
}
}

View File

@ -1,5 +1,5 @@
{
"version": "2.10.3",
"version": "2.10.4",
"author": "Grant Howard, Coulomb-G",
"copyright": "[year], Grant Howard (https://github.com/the1812) & Coulomb-G (https://github.com/Coulomb-G)",
"license": "MIT",

View File

@ -38,6 +38,7 @@ export const allVideoUrls = [...videoAndBangumiUrls, ...cheeseUrls]
/** 主站及各分区页面 */
export const mainSiteUrls = [
'https://www.bilibili.com/v/',
'https://www.bilibili.com/c/',
/^https:\/\/www\.bilibili\.com\/$/,
/^https:\/\/www\.bilibili\.com\/([^\/]+)\.html$/,
/^https:\/\/www\.bilibili\.com\/watchlater\/#\/list$/,