feat: add smart pattern detection for emails, names, usernames, phones
Instead of requiring explicit mappings for every variation, users now configure their identity once (Identity tab) and Silent Send auto-catches: - Emails: any address @gmail, @yahoo, @outlook, etc. - Names: first/last, full name, reversed, possessives, case variants - Usernames: user@host, ~user, /home/user, C:\Users\user - Phones: all common formats ((555) 123-4567, 555.123.4567, etc.) Smart patterns run before explicit mappings, so explicit rules can override smart catches when needed. https://claude.ai/code/session_01Dvgwe7XMoSxnWXkih8p1Cw
This commit is contained in:
@@ -9,6 +9,7 @@ import api from './browser-polyfill.js';
|
||||
|
||||
const KEYS = {
|
||||
MAPPINGS: 'ss_mappings',
|
||||
IDENTITY: 'ss_identity',
|
||||
LOG: 'ss_activity_log',
|
||||
SETTINGS: 'ss_settings',
|
||||
};
|
||||
@@ -64,6 +65,25 @@ const Storage = {
|
||||
await this.saveMappings(filtered);
|
||||
},
|
||||
|
||||
// --- Identity (Smart Patterns) ---
|
||||
|
||||
async getIdentity() {
|
||||
const result = await api.storage.local.get(KEYS.IDENTITY);
|
||||
return result[KEYS.IDENTITY] || {
|
||||
emails: [],
|
||||
names: [],
|
||||
usernames: [],
|
||||
phones: [],
|
||||
catchAllEmail: '',
|
||||
emailDomains: [],
|
||||
enabled: { emails: true, names: true, usernames: true, phones: true, paths: true },
|
||||
};
|
||||
},
|
||||
|
||||
async saveIdentity(identity) {
|
||||
await api.storage.local.set({ [KEYS.IDENTITY]: identity });
|
||||
},
|
||||
|
||||
// --- Activity Log ---
|
||||
|
||||
async getLog() {
|
||||
|
||||
Reference in New Issue
Block a user