94 Commits
Author SHA1 Message Date
hawkgs 8844e89b9f perf(devtools): use HTML canvas for the highlighter (#71046)
The existing highlighting mechanism relies on DOM elements.
This has some implications like introducing layout thrashing
since each highlight adds/removes elements to and from the tree.
This change converts the higlighter to HTML canvas renderer which
should introduce minimal performance overhead when inspecting the app.

PR Close #71046
2026-11-11 19:18:27 +00:00
hawkgs 7c8c8d177b refactor(devtools): split component-tree logic into other modules
Split the `directive-forest/component-tree` logic into other modules and
utilities. `component-tree` was the only remnant of the legacy BE code
organization. The refactor doesn't change any logic, but converts some
remaining arrow functions to standard functions and performs a few renames.
2026-11-03 16:30:00 -08:00
hawkgs 500d8709b7 refactor(devtools): remove leading underscores of private class members
Remove all prefixes of private members to match the currently followed convention.
Remaining places that still use underscores (excluded from the refactor):
- `tab-update/index.ts`
- `splitArea.directive.ts` (part of the old vendor code)
2026-10-09 17:14:37 -07:00
Edu 36a0ab6ed8 fix(devtools): sync breakpoint UI state and allow removal after debugger detach
When a user cancels Chrome's debugging infobar while a signal breakpoint is active, `chrome.debugger.onDetach` clears the active breakpoints map in the background service worker. Previously, the DevTools panel UI was not notified of this event, leaving the breakpoint icon displayed as active, and subsequently clicking to disable it threw an error because the entry was already absent from `activeBreakpoints`.

This change:
1. Broadcasts a `signalBreakpointsCleared` message from `BreakpointManager` when `chrome.debugger.onDetach` fires so `SignalGraphPaneComponent` immediately clears its active breakpoints state.
2. Makes `BreakpointManager.removeBreakpoint` return early as a no-op if the breakpoint or tab entry is already absent.

Fixes #70949
2026-09-29 12:20:46 -07:00
Alan Agius c0c5d452c3 test(devtools): assert on eval spy in chrome-application-operations spec
Avoid asserting on chrome.devtools.inspectedWindow.eval directly via
Jasmine matchers, as TypeScript picks up the 3-argument overload
signature from @types/chrome, causing a TS2554 compilation error when
only 2 arguments are provided. Instead, assert directly on the
evalSpy instance.
2026-09-22 14:00:51 -07:00
Максим Иванов c2143bb240 refactor(devtools): type message bus listeners
Use explicit listener function types for the Chrome and iframe message
buses instead of storing callbacks as `any[]`.
2026-09-21 09:36:23 -07:00
Edu e02c4d89bc fix(devtools): harden message sender validation and expand property shape tests
Explicitly validate sender.origin and sender.url, guard against non-object
or missing sender properties, and add comprehensive unit test coverage
for all optional property permutations of chrome.runtime.MessageSender.
2026-09-16 14:56:37 +02:00
Edu 11838e481a fix(devtools): validate message sender and detach debugger in BreakpointManager
Ensure runtime messages for setting and querying signal breakpoints
originate strictly from the extension's internal DevTools panel context,
preventing untrusted web pages or content scripts from triggering debugger
attachments or placing breakpoints.

- Validate sender.id, sender.tab (must be undefined), and sender.url.
- Validate tabId to ensure it is a positive integer.
- Detach chrome.debugger when all breakpoints on a tab are removed.
- Namespace scriptMap by tabId to prevent cross-tab script collisions.
- Add unit test suite in breakpoint_manager.spec.ts.
2026-09-16 14:56:37 +02:00
Georgi Serev fe94aae034 refactor(devtools): introduce a global backend config
- Unify the multiple scattered feature-specific flags into a single
global backend config
- Fix initial settings data exchange between the fe and be on prod
2026-09-16 14:12:42 +02:00
Kam d6d51a0ef8 test(devtools): run the orphaned app component spec
`app.component.spec.ts` has been in the tree since the initial DevTools commit
in 2020, but no revision of `shell-browser/src/app/BUILD.bazel` has ever listed
it, and that file has no globs. Two of the three specs in the directory are
wired up; this one has never run.

It could not run as written. The setup declared `AppComponent` and imported
`RouterModule.forRoot([])`, neither of which applies now that the component is
standalone and injects `MessageBus` and `DEEP_LINK_INSTANCE_ID`.

It now stubs the `chrome.devtools` surface that `ngOnInit` reads and covers
both lifecycle hooks: the listeners registered on init, the two performance
track emits, the three guards on the deep link listener, and the listeners
removed on destroy.

Follow-up to #70570, which fixed the same problem in ng-devtools-backend.
2026-09-09 16:11:01 +02:00
Edu 12b0acd498 feat(devtools): implement persistent breakpoints on signal consumers using CDP
Implements persistent breakpoints for Angular signal consumers (computeds and effects) in Angular DevTools using Chrome DevTools Protocol (CDP).

- Adds debugger permission to Chrome and Firefox extension manifests.
- Implements CDP breakpoint orchestration in background script.
- Updates SignalDetailsComponent and SignalGraphPaneComponent with label icon toggle and persistent state sync across reloads.
2026-08-14 08:26:55 -07:00
Matthieu Riegler 03f1758e2a fix(devtools): fix regression for node serialization.
This fixes a regression introduced by #69309 where the format of `serializedId` from a coma separated string, to a JSON representation of an array.

fixes #70104
2026-08-07 16:30:22 -07:00
Matthieu Riegler 3a29329191 fix(devtools): Extension name for non googlers.
For corps urls the promise is actually resolved but returns a `status:0`.

fixes #70023
2026-07-31 11:18:21 -07:00
Edu 1b09130640 feat(devtools): rename DevTools tab to "Angular & Wiz" for Googlers
Conditionally update the browser DevTools tab name to "Angular & Wiz" if the user is identified as a Google employee via internal corp network detection.
2026-07-29 08:41:07 -07:00
Georgi Serev 184c4797b8 refactor(devtools): rename timing API to performance track
Rename Timing API to Performance Track to better reflect the purpose of the actual feature;
Migrate the settings data object to match the new name and drop some redundant keys.
2026-07-29 08:38:39 -07:00
hawkgs a7ebf1cd69 refactor(devtools): reorganize backend code
Organize code into domain/feature-specific folders and a shared API folder.
2026-07-20 11:15:53 +02:00
Georgi Serev 98115e8137 refactor(devtools): revamp highlighter
Revamp the highlighter by introducing a completely new mechanism.
2026-07-15 11:59:04 -07:00
SkyZeroZx 95f56d33fe feat(devtools): Adds deep linking from Chrome Performance panel
Enables direct navigation to Angular components from the Chrome Performance panel's flame graph.

This feature integrates Angular DevTools with Chrome's `setOpenResourceHandler` by registering a custom URL scheme (`angular-devtools://component/{instanceId}`).

Closes #63960
2026-07-06 13:32:32 -07:00
Matthieu Riegler 74fa0588b1 refactor(devtools): ensure code is escaped
By stringifying twice we ensure the code is escape before building the string template.
2026-06-16 08:25:35 -07:00
Matthieu Riegler 7896e74222 refactor(devtools): Prevent cross-tab privilege escalation
The background script must not rely on the user-controllable `port.name` to authenticate DevTools panel connections.
2026-06-03 15:47:34 -07:00
Cameron Smick 0cf8a61e58 refactor(devtools): add optional injector property to DevToolsNode and IndexedNode types
Add an optional injector property to the DevToolsNode and IndexedNode types. Features that require an injector use the injector stored on the node, if it exists, and fall back to getInjectorFromElementNode if it doesn't.
2026-05-19 13:04:15 -07:00
Matthieu Riegler d91070ee4f refactor(devtools): cleanup
This are not the droids you are looking for.
2026-05-01 15:59:40 -07:00
Matthieu Riegler ef38017418 build: move devtools only deps out of the workspace
This reduces the clutering of the workspace package.
2026-04-28 13:05:33 -07:00
Matthieu Riegler 4ad3a1fe37 refactor(core): Don't throw when there are not async metadata
In the context of AOT tests, component with defer blocks no longer throw on instanciation if the component is not overridden (with `overrideComponent`)

Prior to this change, all components with a `@defer` block would throw if `compileComponents` was not invoked.

In none-JIT apps, this change makes `compileComponents()` uneccesary.
2026-04-27 17:04:09 -07:00
Cameron Smick e96673ff64 refactor(devtools): make the DevToolsNode directives property optional
Client-Only Wiz doesn't have the concept of a directive. Once the new ng.getComponentForest function is implemented, Client-Only Wiz cowilluld provide `ComponentTreeNode`s without a `directives`` property. This change supports that case by making the `directives` property optional.
2026-04-23 11:36:00 -07:00
Aleksander Bodurri 36edf4870f fix(devtools): fix incorrect logic in destroy function for ChromeMessageBus
Destroy uses window.removeEventListener but the ChromeMessageBus doesn't actually depend on a window object.

In practice this code is unlikely to ever be reached. If a tab is closed the entire context script JS process is killed so this is not an bug that would be very common or even reachable. That being said for correctness this should not be using window.
2026-03-23 14:51:27 -07:00
splincode 25dad82e43 refactor(devtools): improve test descriptions by fixing spelling
Fixed misspellings in test descriptions in devtools/projects/shell-browser/src/app/tab_manager_spec.ts: recieved/recieves → received/receives in three it(...) titles.
2026-03-23 10:32:39 -07:00
Matthieu Riegler 263b819a75 refactor(devtools): prevent spamming the message bus
This commit adds some state on the bus to prevent sending unecessary messages to the main window.
2026-03-09 10:45:58 -07:00
Alan Agius 786ea441e9 build: force external sourcemaps for esbuild targets
Update the `esbuild` macro in devtools to use
`external` sourcemaps by default and remove the ability to override the `sourcemap` and `sources_content` options.
This change is necessary to ensure that the build is deterministic and 100% reproducible as otherwise Firefox will not publish the build.
2026-03-06 12:13:18 -08:00
Doug Parker fc55996b56 refactor(devtools): don't minify debug builds.
This disables esbuild minification when building DevTools in debug mode, introducing a new `//devtools:debug` flag and a `pnpm run devtools:build:chrome:dev` script to trigger it. This should make debugging a little easier.
2026-02-24 09:28:05 -08:00