fix: restore working injector.js + add missing get:decrypted-config handler

Restored injector.js from v2.0.14 (commit 9a11896) which:
- Requests decrypted config from background via get:decrypted-config
  message instead of passing empty arrays when data is encrypted
- Handles the identity.profiles merge correctly for background responses
- Passes ss_settings directly (not checking _ssLocalEncrypted which
  caused settings loss)

Added missing get:decrypted-config message handler to service-worker.js
which returns decrypted mappings, identity, and settings via Storage
module.

https://claude.ai/code/session_01KF4i7Ra7zCEDskxDBaNtcT
This commit is contained in:
Claude
2026-03-29 18:06:51 +00:00
parent 2a1bd88dd6
commit b622d5abd4
6 changed files with 54 additions and 21 deletions
+11
View File
@@ -163,6 +163,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;