From e59169714a67e33c3e0eb2ef4305db207df25fb5 Mon Sep 17 00:00:00 2001 From: "trop[bot]" <37223003+trop[bot]@users.noreply.github.com> Date: Thu, 16 Apr 2026 15:21:47 -0400 Subject: [PATCH] fix: show 'Electron Isolated Context' in Dev Tools (#51078) Because of a bug after the [upstream refactor][0] Dev Tools stopped showing 'Electron Isolated Context' in the execution context selector. 'Electron Isolated Context' runs with origin set to `file://`. Since domain name is empty for the origin the respective UI item in the context selector is created with an empty `subtitle`. However, with the upstream change items with either of `title` or `subtitle` are omitted from rendering. Here we float an [in-review patch][1] until it is fixed upstream. [0]: https://chromium.googlesource.com/devtools/devtools-frontend.git/+/dbb61cf4b27a8ca13ac62ce7b72c22ad2664b460 [1]: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/7761316 Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com> Co-authored-by: Fedor Indutny --- patches/devtools_frontend/.patches | 1 + ...ector_not_showing_execution_contexts.patch | 25 +++++++++++++++++++ 2 files changed, 26 insertions(+) create mode 100644 patches/devtools_frontend/fix_context_selector_not_showing_execution_contexts.patch diff --git a/patches/devtools_frontend/.patches b/patches/devtools_frontend/.patches index b6487851e3..e0f215cf02 100644 --- a/patches/devtools_frontend/.patches +++ b/patches/devtools_frontend/.patches @@ -1,3 +1,4 @@ chore_expose_ui_to_allow_electron_to_set_dock_side.patch fix_prefer_browser_runtime_over_node_in_hostruntime_detection.patch feat_allow_enabling_extension_panels_on_custom_protocols.patch +fix_context_selector_not_showing_execution_contexts.patch diff --git a/patches/devtools_frontend/fix_context_selector_not_showing_execution_contexts.patch b/patches/devtools_frontend/fix_context_selector_not_showing_execution_contexts.patch new file mode 100644 index 0000000000..5c7eddd56e --- /dev/null +++ b/patches/devtools_frontend/fix_context_selector_not_showing_execution_contexts.patch @@ -0,0 +1,25 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Fedor Indutny +Date: Tue, 14 Apr 2026 19:33:23 -0700 +Subject: Fix context selector not showing execution contexts + +When execution context's origin is `file://` - the `url.domain()` is an +empty string and the item's subtitle becomes falsy. Since we predicated +rendering of an item on presence of both title and subtitle - the items +were not rendered while still taking space in the dropdown. + +Pending CL: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/7761316 + +diff --git a/front_end/panels/console/ConsoleContextSelector.ts b/front_end/panels/console/ConsoleContextSelector.ts +index f933dbd6dbdfadd2ea8b78e473d9506350825037..09f590fff0263875b1727bdf7e8dd57a17603ee3 100644 +--- a/front_end/panels/console/ConsoleContextSelector.ts ++++ b/front_end/panels/console/ConsoleContextSelector.ts +@@ -303,7 +303,7 @@ interface ViewInput { + type View = (input: ViewInput, output: undefined, target: HTMLElement) => void; + + const DEFAULT_VIEW: View = (input, _output, target): void => { +- if (!input.title || !input.subtitle) { ++ if (!input.title && !input.subtitle) { + render(nothing, target); + return; + }