diff --git a/src/main/ipc.ts b/src/main/ipc.ts index 4fa662c..1798339 100644 --- a/src/main/ipc.ts +++ b/src/main/ipc.ts @@ -135,6 +135,17 @@ handle(IpcEvents.CLIPBOARD_COPY_IMAGE, async (_, buf: ArrayBuffer, src: string) }); }); +function openDebugPage(page: string) { + const win = new BrowserWindow({ + autoHideMenuBar: true + }); + + win.loadURL(page); +} + +handle(IpcEvents.DEBUG_LAUNCH_GPU, () => openDebugPage("chrome://gpu")); +handle(IpcEvents.DEBUG_LAUNCH_WEBRTC_INTERNALS, () => openDebugPage("chrome://webrtc-internals")); + function readCss() { return readFile(VENCORD_QUICKCSS_FILE, "utf-8").catch(() => ""); } diff --git a/src/preload/VesktopNative.ts b/src/preload/VesktopNative.ts index 7a8b977..136bcf1 100644 --- a/src/preload/VesktopNative.ts +++ b/src/preload/VesktopNative.ts @@ -78,5 +78,9 @@ export const VesktopNative = { clipboard: { copyImage: (imageBuffer: Uint8Array, imageSrc: string) => invoke(IpcEvents.CLIPBOARD_COPY_IMAGE, imageBuffer, imageSrc) + }, + debug: { + launchGpu: () => invoke(IpcEvents.DEBUG_LAUNCH_GPU), + launchWebrtcInternals: () => invoke(IpcEvents.DEBUG_LAUNCH_WEBRTC_INTERNALS) } }; diff --git a/src/renderer/components/settings/VencordLocationPicker.tsx b/src/renderer/components/settings/DeveloperOptions.tsx similarity index 59% rename from src/renderer/components/settings/VencordLocationPicker.tsx rename to src/renderer/components/settings/DeveloperOptions.tsx index 9af4711..eabfbd3 100644 --- a/src/renderer/components/settings/VencordLocationPicker.tsx +++ b/src/renderer/components/settings/DeveloperOptions.tsx @@ -4,12 +4,56 @@ * Copyright (c) 2023 Vendicated and Vencord contributors */ -import { useForceUpdater } from "@vencord/types/utils"; -import { Button, Forms, Toasts } from "@vencord/types/webpack/common"; +import { + Margins, + ModalCloseButton, + ModalContent, + ModalHeader, + ModalRoot, + ModalSize, + openModal, + useForceUpdater +} from "@vencord/types/utils"; +import { Button, Forms, Text, Toasts } from "@vencord/types/webpack/common"; +import { Settings } from "shared/settings"; import { SettingsComponent } from "./Settings"; -export const VencordLocationPicker: SettingsComponent = ({ settings }) => { +export const DeveloperOptionsButton: SettingsComponent = ({ settings }) => { + return ; +}; + +function openDeveloperOptionsModal(settings: Settings) { + openModal(props => ( + + + + Vesktop Developer Options + + + + + +
+ Vencord Location + + + + Debugging + +
+ + +
+
+
+
+ )); +} + +const VencordLocationPicker: SettingsComponent = ({ settings }) => { const forceUpdate = useForceUpdater(); const vencordDir = VesktopNative.fileManager.getVencordDir(); @@ -31,7 +75,7 @@ export const VencordLocationPicker: SettingsComponent = ({ settings }) => { "the default location" )} -
+