Skip to content

Commit 82edce0

Browse files
committed
fix: legacy space version now uses Lit-based comments as well
1 parent dfd0b60 commit 82edce0

1 file changed

Lines changed: 4 additions & 21 deletions

File tree

src/main.ts

Lines changed: 4 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -11,14 +11,14 @@ router.serve(
1111
/** 新版单独动态页 */ 'https://www.bilibili.com/opus/',
1212
/** 课程页 */ 'https://www.bilibili.com/cheese/play/',
1313
/** 话题页 */ 'https://www.bilibili.com/v/topic/detail',
14+
/** 漫画详情页(无 IP 属地数据) */ 'https://manga.bilibili.com/detail/',
15+
/** 节日(如:拜年祭) */ 'https://www.bilibili.com/festival/',
1416
],
1517
hookLit
1618
)
1719

1820
router.serve(/** 活动页 */ 'https://www.bilibili.com/blackboard/', observeAndInjectComments)
1921

20-
router.serve(/** 拜年祭 */ 'https://www.bilibili.com/festival/', hookLit)
21-
2222
router.serve(/** 专栏 */ 'https://www.bilibili.com/read/', async () => {
2323
observeAndInjectComments()
2424
const articleDetail = (await isElementLoaded('.article-detail')) as ArticleDetail
@@ -52,19 +52,7 @@ router.serve('https://www.bilibili.com/v/topic/detail/', () => serveNewComments(
5252
/**
5353
* 个人空间动态页
5454
*/
55-
router.serve(
56-
'https://space.bilibili.com/',
57-
async () => {
58-
const biliMainHeader = await isElementLoaded('#biliMainHeader')
59-
const isFreshSpace = biliMainHeader?.tagName === 'HEADER'
60-
if (isFreshSpace) {
61-
hookLit()
62-
} else {
63-
serveNewComments('.bili-dyn-list__items')
64-
}
65-
},
66-
{ endsWith: 'dynamic' }
67-
)
55+
router.serve('https://space.bilibili.com/', hookLit, { endsWith: 'dynamic' })
6856

6957
/**
7058
* 个人空间首页
@@ -86,7 +74,7 @@ router.serve('https://space.bilibili.com/', async () => {
8674
dynamicTab.addEventListener(
8775
'click',
8876
() => {
89-
serveNewComments('.bili-dyn-list__items')
77+
hookLit()
9078
},
9179
{ once: true }
9280
)
@@ -131,11 +119,6 @@ router.serve('https://t.bilibili.com/', async () => {
131119
*/
132120
router.serve('https://www.bilibili.com/blackroom/ban/', () => hookBBComment({ blackroom: true }))
133121

134-
/**
135-
* 漫画详情页
136-
*/
137-
router.serve('https://manga.bilibili.com/detail/', observeAndInjectComments)
138-
139122
const { origin, pathname } = new URL(location.href)
140123
const urlWithoutQueryOrHash = `${origin}${pathname}`
141124

0 commit comments

Comments
 (0)