Repository navigation
fix: show Inspect UI5 element only when UI5 panel is active - #389
Merged
Merged
Conversation
yanaminkova
approved these changes
Oct 26, 2026
kgogov
force-pushed
the
context-menu-visibility
branch
from
October 26, 2026 14:43
e300eb6 to
a8563fb
Compare
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
The "Inspect UI5 element" right-click option was always visible on UI5 pages, but silently did nothing unless the UI5 Inspector panel was actively open in DevTools.
Solution
Establish a persistent port from the DevTools page to the background service worker. When DevTools close, the port disconnects and the context menu is removed. Combined with the existing panel show/hide logic, the option now only appears while the UI5 Inspector panel is active.
The panel state is persisted in
chrome.storage.sessionso it survives MV3 service-worker eviction/respawn, and a startup reconciliation step removes any orphaned context menu left behind by a previous worker generation.Additional Fix: Highlight Overlay Clearing
The blue highlight overlay (shown when hovering a control in the tree / elements registry) could get stuck on the page. The overlay's original self-clear — hiding itself on mouseover — stopped working once the wrapper was given
pointer-events: none, so it no longer received page hovers.The overlay is now cleared in all the cases where the inspector stops being the focus:
mouseleavelistener on the panel root broadcasts a hide message.