From 5a4018dcfe3110f7cce3b121cd2b1c0a2e88a75f Mon Sep 17 00:00:00 2001 From: LC mac Date: Thu, 29 Jan 2026 01:20:50 +0800 Subject: [PATCH] feat(v1.2.1): add security monitoring components - Add Storage Indicator (browser localStorage/sessionStorage monitor) - Add Security Warnings (educational panel on JS limitations) - Add Clipboard Tracker (copy event detection with clear function) - Add data-sensitive attributes to sensitive fields Security Features: - Real-time storage monitoring with sensitive data highlighting - Clipboard activity tracking with character count - System clipboard clearing functionality - Collapsible floating widgets (non-intrusive) - Auto-refresh storage display every 2s - Educational warnings about GC, string immutability, etc. UI/UX: - Floating widgets: Storage (bottom-right), Warnings (bottom-left), Clipboard (bottom-right stacked) - Color-coded alerts (red=sensitive, orange=activity, yellow=warnings) - Responsive and clean design with TailwindCSS --- src/App.tsx | 16 +++ src/components/ClipboardTracker.tsx | 184 ++++++++++++++++++++++++++++ src/components/SecurityWarnings.tsx | 81 ++++++++++++ src/components/StorageIndicator.tsx | 150 +++++++++++++++++++++++ src/lib/seedpgp.ts | 6 + src/main.tsx | 20 +++ 6 files changed, 457 insertions(+) create mode 100644 src/components/ClipboardTracker.tsx create mode 100644 src/components/SecurityWarnings.tsx create mode 100644 src/components/StorageIndicator.tsx diff --git a/src/App.tsx b/src/App.tsx index b58d463..936e172 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -19,6 +19,9 @@ import { validateBip39Mnemonic } from './lib/bip39'; import { buildPlaintext, encryptToSeedPgp, decryptSeedPgp } from './lib/seedpgp'; import type { SeedPgpPlaintext } from './lib/types'; import * as openpgp from 'openpgp'; +import { StorageIndicator } from './components/StorageIndicator'; +import { SecurityWarnings } from './components/SecurityWarnings'; +import { ClipboardTracker } from './components/ClipboardTracker'; console.log("OpenPGP.js version:", openpgp.config.versionString); @@ -197,6 +200,7 @@ function App() {