diff options
author | V <vendicated@riseup.net> | 2023-09-21 18:56:58 +0200 |
---|---|---|
committer | V <vendicated@riseup.net> | 2023-09-21 18:56:58 +0200 |
commit | 97b6699afefe373d510dda5589a0754a4b380153 (patch) | |
tree | 112c8dd963aa4ed64702c9444738fbcca9d4674a /src | |
parent | 7e91edc7577ba65fab08bc45c07cbd6f1756bd6f (diff) | |
download | Vencord-97b6699afefe373d510dda5589a0754a4b380153.tar.gz Vencord-97b6699afefe373d510dda5589a0754a4b380153.tar.bz2 Vencord-97b6699afefe373d510dda5589a0754a4b380153.zip |
Fuck you Mozilla
Diffstat (limited to 'src')
-rw-r--r-- | src/components/VencordSettings/ThemesTab.tsx | 25 | ||||
-rw-r--r-- | src/components/VencordSettings/VencordTab.tsx | 15 | ||||
-rw-r--r-- | src/plugins/_core/supportHelper.tsx | 19 | ||||
-rw-r--r-- | src/utils/constants.ts | 2 |
4 files changed, 48 insertions, 13 deletions
diff --git a/src/components/VencordSettings/ThemesTab.tsx b/src/components/VencordSettings/ThemesTab.tsx index 4ff5be5..37d06c7 100644 --- a/src/components/VencordSettings/ThemesTab.tsx +++ b/src/components/VencordSettings/ThemesTab.tsx @@ -18,8 +18,10 @@ import { useSettings } from "@api/Settings"; import { classNameFactory } from "@api/Styles"; +import { ErrorCard } from "@components/ErrorCard"; import { Flex } from "@components/Flex"; import { Link } from "@components/Link"; +import { IsFirefox } from "@utils/constants"; import { Margins } from "@utils/margins"; import { classes } from "@utils/misc"; import { showItemInFolder } from "@utils/native"; @@ -249,12 +251,14 @@ function ThemesTab() { > Load missing Themes </Button> - <Button - onClick={() => VencordNative.quickCss.openEditor()} - size={Button.Sizes.SMALL} - > - Edit QuickCSS - </Button> + {!IsFirefox && ( + <Button + onClick={() => VencordNative.quickCss.openEditor()} + size={Button.Sizes.SMALL} + > + Edit QuickCSS + </Button> + )} </> </Card> @@ -316,6 +320,15 @@ function ThemesTab() { return ( <SettingsTab title="Themes"> + {IsFirefox && ( + <ErrorCard> + <Forms.FormTitle tag="h5">Warning</Forms.FormTitle> + <Forms.FormText> + You are using Firefox. Expect the vast majority of themes to not work. + If this is a problem, use a chromium browser or Discord Desktop / Vesktop. + </Forms.FormText> + </ErrorCard> + )} <TabBar type="top" look="brand" diff --git a/src/components/VencordSettings/VencordTab.tsx b/src/components/VencordSettings/VencordTab.tsx index a8e9ea5..520e4da 100644 --- a/src/components/VencordSettings/VencordTab.tsx +++ b/src/components/VencordSettings/VencordTab.tsx @@ -21,6 +21,7 @@ import { Settings, useSettings } from "@api/Settings"; import { classNameFactory } from "@api/Styles"; import DonateButton from "@components/DonateButton"; import { ErrorCard } from "@components/ErrorCard"; +import { IsFirefox } from "@utils/constants"; import { Margins } from "@utils/margins"; import { identity } from "@utils/misc"; import { relaunch, showItemInFolder } from "@utils/native"; @@ -109,12 +110,14 @@ function VencordSettings() { Restart Client </Button> )} - <Button - onClick={() => VencordNative.quickCss.openEditor()} - size={Button.Sizes.SMALL} - disabled={settingsDir === "Loading..."}> - Open QuickCSS File - </Button> + {!IsFirefox && ( + <Button + onClick={() => VencordNative.quickCss.openEditor()} + size={Button.Sizes.SMALL} + disabled={settingsDir === "Loading..."}> + Open QuickCSS File + </Button> + )} {!IS_WEB && ( <Button onClick={() => showItemInFolder(settingsDir)} diff --git a/src/plugins/_core/supportHelper.tsx b/src/plugins/_core/supportHelper.tsx index 674be8e..2e86869 100644 --- a/src/plugins/_core/supportHelper.tsx +++ b/src/plugins/_core/supportHelper.tsx @@ -17,7 +17,7 @@ */ import { DataStore } from "@api/index"; -import { Devs, SUPPORT_CHANNEL_ID } from "@utils/constants"; +import { Devs, IsFirefox, SUPPORT_CHANNEL_ID } from "@utils/constants"; import { isPluginDev } from "@utils/misc"; import { makeCodeblock } from "@utils/text"; import definePlugin from "@utils/types"; @@ -30,6 +30,7 @@ import plugins from "~plugins"; import settings from "./settings"; const REMEMBER_DISMISS_KEY = "Vencord-SupportHelper-Dismiss"; +const FIREFOX_DISMISS_KEY = "Vencord-Firefox-Warning-Dismiss"; const AllowedChannelIds = [ SUPPORT_CHANNEL_ID, @@ -115,6 +116,22 @@ ${makeCodeblock(enabledPlugins.join(", ") + "\n\n" + enabledApiPlugins.join(", " onConfirm: rememberDismiss }); } + + if (IsFirefox) { + const rememberDismiss = () => DataStore.set(FIREFOX_DISMISS_KEY, true); + + Alerts.show({ + title: "Hold on!", + body: <div> + <Forms.FormText>You are using Firefox.</Forms.FormText> + <Forms.FormText>Due to Firefox's stupid extension guidelines, most themes and many plugins will not function correctly.</Forms.FormText> + <Forms.FormText>Do not report bugs. Do not ask for help with broken plugins.</Forms.FormText> + <Forms.FormText>Instead, use a chromium browser, Discord Desktop, or Vesktop.</Forms.FormText> + </div>, + onCancel: rememberDismiss, + onConfirm: rememberDismiss + }); + } } } }); diff --git a/src/utils/constants.ts b/src/utils/constants.ts index cd6a7a2..80f0787 100644 --- a/src/utils/constants.ts +++ b/src/utils/constants.ts @@ -385,3 +385,5 @@ export const DevsById = /* #__PURE__*/ (() => .map(([_, v]) => [v.id, v] as const) )) )() as Record<string, Dev>; + +export const IsFirefox = IS_EXTENSION && navigator.userAgent.toLowerCase().includes("firefox"); |