Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: webContents.openDevTools({mode}) not working
- Loading branch information
1 parent
841d223
commit 4a3a38d
Showing
3 changed files
with
51 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
fix_expose_globals_to_allow_patching_devtools_dock.patch |
48 changes: 48 additions & 0 deletions
48
patches/devtools_frontend/fix_expose_globals_to_allow_patching_devtools_dock.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 | ||
From: Shelley Vohr <shelley.vohr@gmail.com> | ||
Date: Wed, 9 Feb 2022 10:55:54 +0100 | ||
Subject: fix: expose globals to allow patching Devtools dock | ||
|
||
Electron calls into UI.DockController.instance().setDockSide(side) in | ||
order to allow users to set the dock position via | ||
webContents.openDevTool({ mode }). In https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/3310870 | ||
the globals which we used to enable this were removed, and so we need to | ||
re-expose them to fix this broken functionality. We should look to | ||
upstream a more durable approach to allowing us to do this, at which | ||
point this patch can be removed. | ||
|
||
diff --git a/front_end/entrypoints/shell/BUILD.gn b/front_end/entrypoints/shell/BUILD.gn | ||
index bf96adcaa42a2406cf1dd7cd2468802886aa4fd7..cd84442cab4a0da772dd37cd4e921041b3b6173a 100644 | ||
--- a/front_end/entrypoints/shell/BUILD.gn | ||
+++ b/front_end/entrypoints/shell/BUILD.gn | ||
@@ -31,6 +31,7 @@ devtools_entrypoint("shell") { | ||
"../../ui/legacy/components/perf_ui:meta", | ||
"../../ui/legacy/components/quick_open:meta", | ||
"../../ui/legacy/components/source_frame:meta", | ||
+ "../../ui/legacy:legacy", | ||
] | ||
|
||
visibility = [ | ||
diff --git a/front_end/entrypoints/shell/shell.ts b/front_end/entrypoints/shell/shell.ts | ||
index 89255a0927a647ca32d1a9508853425a3207b441..f0e1e32f80d79e400ad139818edce60aff6aeb89 100644 | ||
--- a/front_end/entrypoints/shell/shell.ts | ||
+++ b/front_end/entrypoints/shell/shell.ts | ||
@@ -20,6 +20,7 @@ import '../../models/logs/logs-meta.js'; | ||
import '../main/main-meta.js'; | ||
import '../../ui/legacy/components/perf_ui/perf_ui-meta.js'; | ||
import '../../ui/legacy/components/quick_open/quick_open-meta.js'; | ||
+import '../../ui/legacy/legacy-legacy.js'; | ||
import '../../core/sdk/sdk-meta.js'; | ||
import '../../ui/legacy/components/source_frame/source_frame-meta.js'; | ||
import '../../panels/console_counters/console_counters-meta.js'; | ||
diff --git a/front_end/ui/legacy/BUILD.gn b/front_end/ui/legacy/BUILD.gn | ||
index fe7c150cf6ce24b10821fa5a91d55f82cf865222..7177d495ec9e2b31a641c7a531b63584c597cf97 100644 | ||
--- a/front_end/ui/legacy/BUILD.gn | ||
+++ b/front_end/ui/legacy/BUILD.gn | ||
@@ -182,5 +182,6 @@ devtools_entrypoint("legacy") { | ||
visibility = [ | ||
"../..:legacy_entrypoints", | ||
"../../legacy_test_runner/*", | ||
+ "../../entrypoints/shell/*", | ||
] | ||
} |