ext(sw): add list_groups popup handler
This commit is contained in:
@@ -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 } };
|
||||
|
||||
Reference in New Issue
Block a user