(() => { const SOURCE = "peach-firefox-sender-probe"; const ALLOWED_TYPES = new Set(["GET_ENTRIES", "GET_RECOVERY_WORDS", "GET_SETTINGS"]); window.addEventListener("message", async (event) => { if (event.source !== window || event.data?.source !== SOURCE) return; const { id, message } = event.data; if (typeof id !== "string" || !message || !ALLOWED_TYPES.has(message.type)) return; let response; try { response = await chrome.runtime.sendMessage(message); } catch (error) { response = { ok: false, error: String(error) }; } window.postMessage({ source: SOURCE, id, response }, window.location.origin); }); })();