mirror of
https://github.com/Equicord/Equicord.git
synced 2025-06-07 13:43:03 -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();
|
return await res.blob();
|
||||||
}
|
}
|
||||||
|
|
||||||
let result;
|
let requiredByPlatform = false;
|
||||||
switch (true) {
|
let hideSetting = false;
|
||||||
case IS_VESKTOP || IS_EQUIBOP:
|
|
||||||
case "legcord" in window:
|
|
||||||
case "goofcord" in window:
|
|
||||||
result = true;
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
result = 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({
|
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
|
// 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: {
|
addBack: {
|
||||||
type: OptionType.BOOLEAN,
|
type: OptionType.BOOLEAN,
|
||||||
description: "Add back the Discord context menus for images, links and the chat input bar",
|
description: "Add back the Discord context menus for images, links and the chat input bar",
|
||||||
default: false,
|
default: true,
|
||||||
restartNeeded: true,
|
restartNeeded: true,
|
||||||
// Web slate menu has proper spellcheck suggestions and image context menu is also pretty good,
|
// 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
|
// 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 MEDIA_PROXY_URL = "https://media.discordapp.net";
|
||||||
const CDN_URL = "cdn.discordapp.com";
|
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)",
|
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],
|
authors: [Devs.Ven],
|
||||||
enabledByDefault: true,
|
enabledByDefault: true,
|
||||||
required: result,
|
required: requiredByPlatform,
|
||||||
|
|
||||||
settings,
|
settings,
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue