diff --git a/manifest.firefox.json b/manifest.firefox.json index 88a25c0..6119cb2 100644 --- a/manifest.firefox.json +++ b/manifest.firefox.json @@ -1,7 +1,7 @@ { "manifest_version": 3, "name": "Silent Send", - "version": "0.9.18", + "version": "0.9.19", "description": "Intercepts personal info and substitutes it with user-defined replacements before sending to AI services.", "browser_specific_settings": { "gecko": { diff --git a/manifest.json b/manifest.json index 7bbf2af..44e7427 100644 --- a/manifest.json +++ b/manifest.json @@ -1,7 +1,7 @@ { "manifest_version": 3, "name": "Silent Send", - "version": "0.9.18", + "version": "0.9.19", "description": "Intercepts personal info and substitutes it with user-defined replacements before sending to AI services.", "permissions": [ "storage", diff --git a/package.json b/package.json index 53dc201..2c8ed42 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "silent-send", - "version": "0.9.18", + "version": "0.9.19", "private": true, "license": "MIT", "description": "Browser extension that substitutes personal data before sending to AI services", diff --git a/src/background/service-worker.js b/src/background/service-worker.js index ce045b1..db0b985 100644 --- a/src/background/service-worker.js +++ b/src/background/service-worker.js @@ -164,6 +164,17 @@ api.runtime.onMessage.addListener((message, sender, sendResponse) => { }); const messageHandlers = { + async 'get:decrypted-config'(_message, _sender, sendResponse) { + try { + const mappings = await Storage.getMappings(); + const identity = await Storage.getIdentity(); + const settings = await Storage.getSettings(); + sendResponse({ mappings, identity, settings }); + } catch { + sendResponse(null); + } + }, + async 'substitution:performed'(message, sender) { const tabId = sender.tab?.id; if (tabId == null) return; diff --git a/src/content/injector.js b/src/content/injector.js index cd6ea67..4c3d5a2 100644 --- a/src/content/injector.js +++ b/src/content/injector.js @@ -118,8 +118,6 @@ // Also log directly from the injector (content script world) // in case the background worker is asleep const replacements = event.data.replacements || []; - const settingsResult = await api.storage.local.get('ss_settings'); - const maxLog = settingsResult.ss_settings?.maxLogEntries || 100; for (const r of replacements) { const log = (await api.storage.local.get('ss_activity_log')).ss_activity_log || []; log.unshift({ @@ -133,8 +131,8 @@ pattern: r.pattern || '', url: location.href, }); - // Trim to user-configured max - if (log.length > maxLog) log.length = maxLog; + // Trim + if (log.length > 200) log.length = 200; await api.storage.local.set({ ss_activity_log: log }); } } @@ -154,10 +152,7 @@ const val = changes.ss_identity.newValue; if (!val?._ssLocalEncrypted) msg.identity = mergeProfiles(val); } - if (changes.ss_settings) { - const val = changes.ss_settings.newValue; - if (!val?._ssLocalEncrypted) msg.settings = val; - } + if (changes.ss_settings) msg.settings = changes.ss_settings.newValue; // Only post if we have something meaningful to send if (msg.mappings || msg.identity || msg.settings) { diff --git a/src/options/options.html b/src/options/options.html index 03e15dc..e87a70f 100644 --- a/src/options/options.html +++ b/src/options/options.html @@ -631,7 +631,7 @@