1
0
mirror of https://github.com/XFox111/PasswordGeneratorExtension.git synced 2026-04-22 08:08:01 +03:00
Files
PasswordGeneratorExtension/utils/links.ts
T
Eugene Fox 3ecb6c4a31 Major 4.0 (#380)
- Migrated to WXT
- Migrated to NPM
- Added Insert & copy action
- Added ESLint
2024-09-25 16:19:12 +03:00

43 lines
1.4 KiB
TypeScript

import { Manifest } from "webextension-polyfill";
export const personalLinks =
{
website: "https://xfox111.net",
twitter: "https://twitter.com/xfox111",
donation: "https://buymeacoffee.com/xfox111"
};
export const storeLinks =
{
chrome: "https://chrome.google.com/webstore/detail/password-generator/jnjobgjobffgmgfnkpkjfjkkfhfikmfl",
edge: "https://microsoftedge.microsoft.com/addons/detail/password-generator/manimdhobjbkfpeeehlhhneookiokpbj",
firefox: "https://addons.mozilla.org/firefox/addon/easy-password-generator"
};
const getGithub = (path?: string): string =>
new URL(path ?? "", "https://github.com/xfox111/PasswordGeneratorExtension/").href;
export const githubLinks =
{
repository: getGithub(),
changelog: getGithub("releases/latest"),
translationGuide: getGithub("wiki/Contribution-Guidelines#contributing-to-translations"),
license: getGithub("blob/main/LICENSE")
};
export const getFeedbackLink = () =>
{
if (import.meta.env.FIREFOX)
return storeLinks.firefox;
const manifest: Manifest.WebExtensionManifest = browser.runtime.getManifest();
const updateUrl: URL = new URL((manifest as unknown as Record<string, unknown>).update_url as string ?? "about:blank");
if (updateUrl.host === "edge.microsoft.com")
return storeLinks.edge;
if (updateUrl.host === "clients2.google.com")
return storeLinks.chrome;
return "mailto:feedback@xfox111.net";
};