From 1262fd17c7fb322a65bbda4688833787232c087d Mon Sep 17 00:00:00 2001 From: woohoo Date: Tue, 22 Feb 2022 20:55:51 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E5=A4=9A=E6=AC=A1=E7=83=A6?= =?UTF-8?q?=E4=BA=BA=E7=9A=84=E9=80=9A=E7=9F=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- torn-trans-zhcn.user.js | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/torn-trans-zhcn.user.js b/torn-trans-zhcn.user.js index 100d656..0d75a9f 100644 --- a/torn-trans-zhcn.user.js +++ b/torn-trans-zhcn.user.js @@ -1,8 +1,8 @@ // ==UserScript== -// @lastmodified 202202222023 +// @lastmodified 202202222055 // @name 芜湖助手 // @namespace WOOH -// @version 0.3.18 +// @version 0.3.19 // @description 托恩,起飞! // @author Woohoo[2687093] Sabrina_Devil[2696209] // @match https://www.torn.com/* @@ -23,13 +23,18 @@ if (window.WHTRANS) return; window.WHTRANS = true; // 版本 - const version = '0.3.18'; + const version = '0.3.19'; // 修改历史 const changelist = [ { todo: true, cont: `翻译:baza npc商店、imarket、imarket搜索结果`, }, + { + ver: '0.3.19', + date: '20220222', + cont: `修复多次烦人的通知`, + }, { ver: '0.3.18', date: '20220222', @@ -9080,8 +9085,10 @@ text-decoration:none; // 浏览器通知 try { if (Notification.permission === 'granted' && sysNotify) { + const last_notify = getWhSetting('lastNotify'); + const last_notify_date = new Date(last_notify); const date_local_string = `[${date.getHours()}:${date.getMinutes()}:${date.getSeconds()}]\r` - if (date.getTime() - getWhSetting('lastNotify') > 3000) { + if (!!last_notify_date || date - last_notify_date > 3000) { new Notification('芜湖助手', { body: date_local_string + notify_contain.msgInnerText, requireInteraction: false