electron/patches/devtools_frontend/chore_expose_ui_to_allow_el...

25 lines
1.2 KiB
Diff

From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Shelley Vohr <shelley.vohr@gmail.com>
Date: Wed, 25 Oct 2023 11:48:21 -0400
Subject: chore: expose UI to allow Electron to set dock side
This patch allows Electron to set the dock side via `webContents.openDevTools({ mode })`.
It also allows us to test certain aspects of devtools extensions. We should look for a way
to handle this without patching, but this is fairly clean for now and no longer requires
patching legacy devtools code.
diff --git a/front_end/entrypoints/main/MainImpl.ts b/front_end/entrypoints/main/MainImpl.ts
index 8b83436614220536df46d8691b1691bb9b03f81e..3391775c557f98bd111298d320f766eb20a6958f 100644
--- a/front_end/entrypoints/main/MainImpl.ts
+++ b/front_end/entrypoints/main/MainImpl.ts
@@ -729,6 +729,8 @@ export class MainImpl {
globalThis.Main = globalThis.Main || {};
// @ts-ignore Exported for Tests.js
globalThis.Main.Main = MainImpl;
+// @ts-ignore Exported for Electron
+globalThis.EUI = UI || {};
export class ZoomActionDelegate implements UI.ActionRegistration.ActionDelegate {
handleAction(_context: UI.Context.Context, actionId: string): boolean {