From 570009be40a6e9295af03b89ec5b705965ca8ad0 Mon Sep 17 00:00:00 2001 From: ViggoC Date: Sun, 12 May 2024 13:58:01 +0800 Subject: [PATCH] update unread pattern --- background/notifications.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/background/notifications.js b/background/notifications.js index 7f4b14d..7746828 100644 --- a/background/notifications.js +++ b/background/notifications.js @@ -24,7 +24,7 @@ async function checkMsg() { console.log('开始检查未读消息') let rep = await fetch('https://www.v2ex.com/mission') let text = await rep.text() - let sign = RegExp("([0-9]*?) (条未读提醒|unread)").exec(text) + let sign = RegExp("([0-9]*?) (未读提醒|unread)").exec(text) sign = sign != null && sign[1] || "未登录" if (sign == "未登录") { chrome.action.setIcon({ path: "icon/icon38_nologin.png" }) @@ -39,4 +39,4 @@ async function checkMsg() { chrome.action.setIcon({ path: "icon/icon38.png" }) chrome.action.setBadgeText({ text: '' }) } -} \ No newline at end of file +}