fix: encrypted data breaks Firefox — injector can't decrypt — v2.0.13

When at-rest encryption is enabled, storage.local contains encrypted
blobs. The injector reads raw storage (content script world, no
access to IndexedDB CryptoKey) and sees { _ssLocalEncrypted: true }.
It passed empty config to content.js → no mappings → no substitution.

This is why Firefox stopped working after encryption was enabled.
Chrome/Brave worked because the user hadn't set up encryption there.

Fixed: injector now detects encrypted data and asks the background
script for decrypted config via 'get:decrypted-config' message.
The background uses the Storage module (which has IndexedDB access)
to decrypt and return the data. Falls back to empty config if the
vault is actually locked.

https://claude.ai/code/session_01SWSwDfMVij53bCTNSCLMwn
This commit is contained in:
Claude
2026-03-27 16:58:40 +00:00
parent c42a4aa55e
commit 5c863b084d
6 changed files with 51 additions and 13 deletions
+11
View File
@@ -163,6 +163,17 @@ const messageHandlers = {
await setupAutoSyncAlarm();
},
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 'org:config-changed'() {
await setupOrgPolicyAlarm();
},