{{ message }}
DevTools: Add monitoring on/off toggle#33760
Draft
Makio64 wants to merge 7 commits into
Draft
Conversation
Adds an Off mode to the devtools panel that makes the extension inert on the inspected page: the 1s state polling stops (full scene traversal, forced layout reads and postMessage batches with it) and hover details/highlight messages are suppressed. The choice persists in localStorage and defaults to On. Since stopping the poll lets the MV3 service worker idle out and close the panel port, the connection is now re-established on disconnect, and top-level navigations are additionally detected via chrome.devtools.network.onNavigated so state is cleared even when the 'committed' message is lost during a service worker restart. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Owner
While the panel is open, clicking the extension icon toggles monitoring on/off and the badge shows 'off' while paused (the revision is restored on re-enable). Without an open panel the icon click keeps its previous scroll-to-canvas behavior. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Right-clicking the extension icon now offers a 'Toggle monitoring' menu option while the panel is open; left-clicking the icon keeps its scroll-to-canvas behavior. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Right-clicking the extension icon now offers an 'Enable monitoring' checkbox; left-click keeps its scroll-to-canvas behavior. The state moved from panel localStorage to chrome.storage.local so the background script owns it: it sets the badge directly when a page registers, keeps the menu checkbox, panel button, badge and page bridges in sync, and remembers each tab's revision in chrome.storage.session - fixing the badge sometimes showing a stale off/version state. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
| var MESSAGE_UNHIGHLIGHT_OBJECT = 'unhighlight-object'; | ||
| var MESSAGE_REGISTER = 'register'; | ||
| var MESSAGE_COMMITTED = 'committed'; | ||
| var MESSAGE_SET_MONITORING = 'set-monitoring'; |
| var MESSAGE_SET_MONITORING = 'set-monitoring'; | ||
|
|
||
| // chrome.storage.local keys | ||
| var STORAGE_KEY_MONITORING = 'monitoring-enabled'; |
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Contributor
Author
Owner
|
UX looks good to me. Code wise feels like a lot of code for such a small feature. What |
Contributor
Author
It was Claude max, but the extra code with the worker was a confirmation due to a bug i met. It's now fix ( fable 5 xhigh ) |
Collaborator
|
Similar to #31015 (comment), do we really need this? You can enable/disable the extension so easily in Chrome. Apart from the large code base change, this feature requires two new permissions which is unfortunate. |
Owner
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.





Related issue: -
Description
While the devtools panel is open it polls the inspected page every second, and each poll runs a full scene-graph traversal, reads
clientWidth/clientHeight(forced layout) and posts whole scene batches across worlds — which can visibly hurt FPS on heavy scenes. Hovering tree items additionally clones objects/materials into the scene for highlighting.This PR adds a monitoring On/Off toggle to the panel header:
request-state/details/highlight (sendState()early-returns), and any active highlight is removed so no wireframe gets stuck in the user's scene. The last snapshot stays visible (dimmed) in the panel.chrome.storage.local(shared across tabs and panels) and defaults to On (current behavior unchanged).offwhile paused (the revision number is restored on re-enable). Left-clicking the icon keeps its existing scroll-to-canvas behavior. The state lives inchrome.storage.localand the background script syncs the menu checkbox, panel button, badge and page bridges from it — the badge is set centrally when a page registers, so it no longer goes stale.Supporting changes this required:
set-monitoringmessage forwarded panel → background → content script → bridge.chrome.devtools.network.onNavigated, so panel state is cleared even when thecommittedmessage is dropped during a service worker restart; while off, iframe navigations no longer wipe the kept snapshot.observepath stays active while off (it is one-shot and cheap), so scenes/renderers created while paused appear instantly on re-enable.The manifest version is intentionally left at 1.16.
🤖 Generated with Claude Code