mirror of
https://github.com/Equicord/Equicord.git
synced 2025-06-07 05:42:55 -04:00
Fixes For WebContextMenus
This commit is contained in:
parent
62b8997443
commit
0b9fde4bf0
1 changed files with 13 additions and 14 deletions
|
@ -36,17 +36,16 @@ async function fetchImage(url: string) {
|
|||
return await res.blob();
|
||||
}
|
||||
|
||||
let result;
|
||||
switch (true) {
|
||||
case IS_VESKTOP || IS_EQUIBOP:
|
||||
case "legcord" in window:
|
||||
case "goofcord" in window:
|
||||
result = true;
|
||||
break;
|
||||
default:
|
||||
result = false;
|
||||
}
|
||||
let requiredByPlatform = false;
|
||||
let hideSetting = false;
|
||||
|
||||
if (IS_VESKTOP || IS_EQUIBOP) {
|
||||
requiredByPlatform = true;
|
||||
hideSetting = true;
|
||||
} else if ("legcord" in window || "goofcord" in window) {
|
||||
requiredByPlatform = true;
|
||||
hideSetting = false;
|
||||
}
|
||||
|
||||
const settings = definePluginSettings({
|
||||
// This needs to be all in one setting because to enable any of these, we need to make Discord use their desktop context
|
||||
|
@ -54,15 +53,15 @@ const settings = definePluginSettings({
|
|||
addBack: {
|
||||
type: OptionType.BOOLEAN,
|
||||
description: "Add back the Discord context menus for images, links and the chat input bar",
|
||||
default: false,
|
||||
default: true,
|
||||
restartNeeded: true,
|
||||
// Web slate menu has proper spellcheck suggestions and image context menu is also pretty good,
|
||||
// so disable this by default. Vesktop just doesn't, so we force enable it there
|
||||
hidden: result,
|
||||
hidden: hideSetting,
|
||||
}
|
||||
});
|
||||
|
||||
const shouldAddBackMenus = () => result || settings.store.addBack;
|
||||
const shouldAddBackMenus = () => hideSetting || settings.store.addBack;
|
||||
|
||||
const MEDIA_PROXY_URL = "https://media.discordapp.net";
|
||||
const CDN_URL = "cdn.discordapp.com";
|
||||
|
@ -91,7 +90,7 @@ export default definePlugin({
|
|||
description: "Re-adds context menus missing in the web version of Discord: Links & Images (Copy/Open Link/Image), Text Area (Copy, Cut, Paste, SpellCheck)",
|
||||
authors: [Devs.Ven],
|
||||
enabledByDefault: true,
|
||||
required: result,
|
||||
required: requiredByPlatform,
|
||||
|
||||
settings,
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue