Skip to content

Commit e68883f

Browse files
committed
fix: 节流标记移到识别入口处生效
上一版 lastDetectionRunAt.set 放在 runActivePageDetection 末尾,中间任何一步抛错都会被 catch 吞掉、标记从未被写入,导致下次 scheduleActivePageDetection 检查 last=0 跳过节流、page-detector 仍以 9-12 秒间隔被反复注入。改为入口处通过 URL 校验后立即记录,确保 30 秒节流真正生效。将版本号提升到 1.2.86。
1 parent d8b79c7 commit e68883f

2 files changed

Lines changed: 2 additions & 2 deletions

File tree

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "stackprism",
33
"private": true,
4-
"version": "1.2.85",
4+
"version": "1.2.86",
55
"type": "module",
66
"description": "StackPrism 用于检测网页前端、后端、CDN、SaaS、广告营销、统计、登录、支付、网站程序和主题模板线索。",
77
"scripts": {

src/background/detection.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,7 @@ export const runActivePageDetection = async (tabId: number) => {
9696
clearBadge(tabId)
9797
return
9898
}
99+
lastDetectionRunAt.set(tabId, Date.now())
99100
await injectContentObserver(tabId)
100101
const [data, rules, settings] = await Promise.all([getTabData(tabId), loadTechRules(), loadDetectorSettings()])
101102
const pageRules = buildEffectivePageRules(rules.page || {}, settings)
@@ -132,7 +133,6 @@ export const runActivePageDetection = async (tabId: number) => {
132133
data.updatedAt = Date.now()
133134
await saveTabDataAndBadge(tabId, data, settings)
134135
scheduleBundleLicenseDetection(tabId)
135-
lastDetectionRunAt.set(tabId, Date.now())
136136
} catch {
137137
return
138138
}

0 commit comments

Comments
 (0)