1
0
forked from icd/rentgen
rentgen/background.ts
2025-10-25 21:29:43 +02:00

23 lines
785 B
TypeScript

import { init } from "./memory";
// Use global browser object directly (available in extension context)
declare const browser: any;
init();
// Test verification: Open a test page to trigger content script
// This proves: background → tabs.create() → content script injection → DOM modification
if (typeof browser !== 'undefined' && browser.tabs) {
browser.tabs.create({
url: 'data:text/html,<html><head><title>Rentgen Test Page</title></head><body><h1>Test</h1></body></html>',
active: false
}).then((tab: any) => {
// Auto-close after content script executes
setTimeout(() => {
browser.tabs.remove(tab.id).catch(() => {});
}, 2000);
}).catch(() => {
// Silently fail if tabs API not available
});
}