import { init } from "./memory"; // Use global browser object directly (available in extension context) declare const browser: any; init(); // Test verification handler for Marionette tests // This proves the background script is executing and can communicate with content scripts browser.runtime.onMessage.addListener((message: any, sender: any, sendResponse: any) => { if (message.type === 'RENTGEN_TEST_VERIFICATION') { // Perform a computation to prove the background script is running // This is not just an echo - we're doing actual processing const inputValue = message.inputValue || 0; const computed = (inputValue * 2) + 3; // Simple but verifiable computation // Send back a response with computed value and metadata const response = { success: true, computed: computed, formula: `(${inputValue} * 2) + 3 = ${computed}`, backgroundTimestamp: Date.now(), receivedFrom: message.url || 'unknown', originalInput: inputValue }; sendResponse(response); return true; // Keep channel open for async response } });