mirror of
https://github.com/wassname/chatGPTBox.git
synced 2026-06-29 05:55:30 +08:00
improve #603
This commit is contained in:
@@ -6,14 +6,14 @@ export default {
|
||||
try {
|
||||
// B站页面是SSR的,如果插入过早,页面 js 检测到实际 Dom 和期望 Dom 不一致,会导致重新渲染
|
||||
await waitForElementToExistAndSelect('img.bili-avatar-img')
|
||||
let oldUrl = location.href
|
||||
const checkUrlChange = async () => {
|
||||
if (location.href !== oldUrl) {
|
||||
oldUrl = location.href
|
||||
let oldPath = location.pathname
|
||||
const checkPathChange = async () => {
|
||||
if (location.pathname !== oldPath) {
|
||||
oldPath = location.pathname
|
||||
mountComponent(config.bilibili, userConfig)
|
||||
}
|
||||
}
|
||||
window.setInterval(checkUrlChange, 500)
|
||||
window.setInterval(checkPathChange, 500)
|
||||
} catch (e) {
|
||||
/* empty */
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user