ext(sw): add list_groups popup handler

This commit is contained in:
adlee-was-taken
2026-05-01 18:08:34 -04:00
parent 61dbb4d3a3
commit 5fbdd30a19
3 changed files with 40 additions and 1 deletions

View File

@@ -159,6 +159,16 @@ export async function handle(
return { ok: true, data: { url: tab.url, title: tab.title ?? '' } };
}
case 'list_groups': {
if (!state.manifest) return { ok: true, data: { groups: [] } };
const set = new Set<string>();
for (const id in state.manifest.items) {
const g = state.manifest.items[id].group;
if (g) set.add(g);
}
return { ok: true, data: { groups: Array.from(set).sort() } };
}
case 'generate_password': {
const password = state.wasm.generate_password(JSON.stringify(msg.request));
return { ok: true, data: { password } };