1
0
mirror of https://github.com/XFox111/PasswordGeneratorExtension.git synced 2026-04-22 08:08:01 +03:00

Major 4.0 (#380)

- Migrated to WXT
- Migrated to NPM
- Added Insert & copy action
- Added ESLint
This commit is contained in:
Eugene Fox
2024-09-25 16:19:12 +03:00
committed by GitHub
parent f2683e37b2
commit 3ecb6c4a31
71 changed files with 14338 additions and 7531 deletions
+24
View File
@@ -0,0 +1,24 @@
export default defineBackground(() => main());
async function main(): Promise<void>
{
await browser.contextMenus.removeAll();
browser.contextMenus.onClicked.addListener(() => browser.action.openPopup());
const showMenu: boolean = (await storage.getItem<boolean>("sync:ContextMenu", { fallback: true }))!;
updateMenus(showMenu);
storage.watch<boolean>("sync:ContextMenu", e => updateMenus(e!));
}
async function updateMenus(showMenus: boolean): Promise<void>
{
await browser.contextMenus.removeAll();
if (showMenus)
browser.contextMenus.create({
id: "password-generator",
title: i18n.t("manifest.name"),
contexts: ["all"],
});
}