Skip to content

Commit 6e0cf8f

Browse files
committed
improve #603
1 parent dcd3415 commit 6e0cf8f

File tree

1 file changed

+5
-5
lines changed
  • src/content-script/site-adapters/bilibili

1 file changed

+5
-5
lines changed

src/content-script/site-adapters/bilibili/index.mjs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,14 @@ export default {
66
try {
77
// B站页面是SSR的,如果插入过早,页面 js 检测到实际 Dom 和期望 Dom 不一致,会导致重新渲染
88
await waitForElementToExistAndSelect('img.bili-avatar-img')
9-
let oldUrl = location.href
10-
const checkUrlChange = async () => {
11-
if (location.href !== oldUrl) {
12-
oldUrl = location.href
9+
let oldPath = location.pathname
10+
const checkPathChange = async () => {
11+
if (location.pathname !== oldPath) {
12+
oldPath = location.pathname
1313
mountComponent(config.bilibili, userConfig)
1414
}
1515
}
16-
window.setInterval(checkUrlChange, 500)
16+
window.setInterval(checkPathChange, 500)
1717
} catch (e) {
1818
/* empty */
1919
}

0 commit comments

Comments
 (0)