mirror of
https://github.com/Vendicated/Vencord.git
synced 2025-01-28 18:26:23 +00:00
17 lines
531 B
TypeScript
17 lines
531 B
TypeScript
|
/*
|
||
|
* Vencord, a Discord client mod
|
||
|
* Copyright (c) 2024 Vendicated and contributors
|
||
|
* SPDX-License-Identifier: GPL-3.0-or-later
|
||
|
*/
|
||
|
|
||
|
import { IpcMainInvokeEvent } from "electron";
|
||
|
|
||
|
export function initDevtoolsOpenEagerLoad(e: IpcMainInvokeEvent) {
|
||
|
const handleDevtoolsOpened = () => e.sender.executeJavaScript("Vencord.Plugins.plugins.ConsoleShortcuts.eagerLoad(true)");
|
||
|
|
||
|
if (e.sender.isDevToolsOpened())
|
||
|
handleDevtoolsOpened();
|
||
|
else
|
||
|
e.sender.once("devtools-opened", () => handleDevtoolsOpened());
|
||
|
}
|