diff options
Diffstat (limited to 'src/utils')
-rw-r--r-- | src/utils/constants.ts | 3 | ||||
-rw-r--r-- | src/utils/ipcEvents.ts | 3 | ||||
-rw-r--r-- | src/utils/quickCss.ts | 6 |
3 files changed, 9 insertions, 3 deletions
diff --git a/src/utils/constants.ts b/src/utils/constants.ts index ef008cd..e948309 100644 --- a/src/utils/constants.ts +++ b/src/utils/constants.ts @@ -1,4 +1 @@ -import { join } from 'path'; - export const WEBPACK_CHUNK = "webpackChunkdiscord_app"; -// export const SETTINGS_DIR = join(process.env.DATA_DIR!, "settings"); diff --git a/src/utils/ipcEvents.ts b/src/utils/ipcEvents.ts new file mode 100644 index 0000000..1920023 --- /dev/null +++ b/src/utils/ipcEvents.ts @@ -0,0 +1,3 @@ +export const IPC_QUICK_CSS_UPDATE = "VencordQuickCssUpdate"; +export const IPC_GET_QUICK_CSS = "VencordGetQuickCss"; +export const IPC_GET_SETTINGS_DIR = "VencordGetSettingsDir";
\ No newline at end of file diff --git a/src/utils/quickCss.ts b/src/utils/quickCss.ts new file mode 100644 index 0000000..573eccc --- /dev/null +++ b/src/utils/quickCss.ts @@ -0,0 +1,6 @@ +document.addEventListener("DOMContentLoaded", async () => { + const style = document.createElement("style"); + document.head.appendChild(style); + VencordNative.handleQuickCssUpdate((css: string) => style.innerText = css); + style.innerText = await VencordNative.getQuickCss(); +});
\ No newline at end of file |