feat: initialise Lildra browser extension

This commit is contained in:
git
2026-07-27 18:33:38 +10:00
commit e6e5336209
9 changed files with 240 additions and 0 deletions
+21
View File
@@ -0,0 +1,21 @@
"use strict";
async function toggleLildra(tab) {
if (!tab?.id) return;
try {
await chrome.scripting.executeScript({
target: { tabId: tab.id },
files: ["lildra.js"]
});
} catch (error) {
console.warn("Lildra could not run on this page:", error);
}
}
chrome.action.onClicked.addListener(toggleLildra);
chrome.commands.onCommand.addListener(async (command) => {
if (command !== "toggle-lildra") return;
const [tab] = await chrome.tabs.query({ active: true, currentWindow: true });
await toggleLildra(tab);
});