Files
angular__angular/devtools/projects/shell-browser/src/app/devtools-connected-flag.ts
T
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

21 lines
803 B
TypeScript

/**
* @license
* Copyright Google LLC All Rights Reserved.
*
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://angular.dev/license
*/
/**
* This content script runs at `document_start` in the MAIN world (Chrome MV3)
* so it executes in the page's JavaScript context **before** any page scripts,
* including Angular.
*
* It sets a global flag that `@angular/core`'s profiler checks when deciding
* whether to emit `angular-devtools://` deep link URLs in `console.timeStamp`
* calls. The flag is only set when the Angular DevTools extension is installed,
* ensuring that custom-scheme links never appear in performance traces on
* browsers where they wouldn't be handled.
*/
(window as any).__NG_DEVTOOLS_CONNECTED__ = true;