aboutsummaryrefslogtreecommitdiff
path: root/src/webpack/common.tsx
diff options
context:
space:
mode:
Diffstat (limited to 'src/webpack/common.tsx')
-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;