aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorCynthia Foxwell <gamers@riseup.net>2022-10-21 16:18:32 -0600
committerGitHub <noreply@github.com>2022-10-22 00:18:32 +0200
commit6769de29cdae4dc4e5b6ab4684380706c336845f (patch)
tree7b1adf729129a807945bae009ca90303c6a09117 /src
parente2b622c76bd3f25f674c4c3ff899bef756cdf6ca (diff)
downloadVencord-6769de29cdae4dc4e5b6ab4684380706c336845f.tar.gz
Vencord-6769de29cdae4dc4e5b6ab4684380706c336845f.tar.bz2
Vencord-6769de29cdae4dc4e5b6ab4684380706c336845f.zip
feat(api): add Clipboard entry in webpack common (#127)
Diffstat (limited to 'src')
-rw-r--r--src/webpack/common.tsx7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/webpack/common.tsx b/src/webpack/common.tsx
index 44cb2b5..6846349 100644
--- a/src/webpack/common.tsx
+++ b/src/webpack/common.tsx
@@ -1,7 +1,7 @@
import { User } from "discord-types/general";
import { lazyWebpack } from "../utils/misc";
-import { _resolveReady, filters, waitFor } from "./webpack";
+import { _resolveReady, filters, waitFor, mapMangledModuleLazy } from "./webpack";
import type Components from "discord-types/components";
import type Stores from "discord-types/stores";
@@ -93,6 +93,11 @@ export const UserUtils = {
fetchUser: lazyWebpack(filters.byCode(".USER(", "getUser")) as (id: string) => Promise<User>,
};
+export const Clipboard = mapMangledModuleLazy('document.queryCommandEnabled("copy")||document.queryCommandSupported("copy")', {
+ copy: filters.byCode(".default.copy("),
+ SUPPORTS_COPY: x => typeof x === "boolean",
+});
+
waitFor("useState", m => React = m);
waitFor(["dispatch", "subscribe"], m => {
FluxDispatcher = m;