From 49bc6ef430e32857f30ef105aa421aba8696e102 Mon Sep 17 00:00:00 2001 From: josc146 Date: Thu, 13 Apr 2023 17:17:27 +0800 Subject: [PATCH] fix: repeated mounting of dynamic pages --- src/content-script/index.jsx | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/content-script/index.jsx b/src/content-script/index.jsx index 8065aa3..7f1b6dc 100644 --- a/src/content-script/index.jsx +++ b/src/content-script/index.jsx @@ -25,7 +25,12 @@ import { changeLanguage } from 'i18next' */ async function mountComponent(siteConfig, userConfig) { const retry = 10 + let oldUrl = location.href for (let i = 1; i <= retry; i++) { + if (location.href !== oldUrl) { + console.log(`SiteAdapters Retry ${i}/${retry}: stop`) + return + } const e = (siteConfig && (getPossibleElementByQuerySelector(siteConfig.sidebarContainerQuery) ||