Skip to content

Commit ccefc85

Browse files
committed
fix: 修复路由错误
1 parent f8abf64 commit ccefc85

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/content/utils/utils.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -186,9 +186,9 @@ export const initUrlChangeEvent = (() => {
186186
const oldReplaceState = history.replaceState
187187
let preUrl: string | undefined = undefined
188188
const onChange = debounce(() => {
189-
const pathname = location.pathname
190-
if (pathname !== preUrl) {
191-
preUrl = pathname
189+
const url = location.href
190+
if (url !== preUrl) {
191+
preUrl = url
192192
window.dispatchEvent(new Event('urlchange'))
193193
}
194194
}, 100)

0 commit comments

Comments
 (0)