Files
angular/devtools/projects/shell-browser/src/app/comm-utils.ts
T
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

43 lines
1.3 KiB
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
*/
export function stripUrlQueryParamsAndFragment(url: string) {
const queryQuestionMarkIdx = url.indexOf('?');
if (queryQuestionMarkIdx > -1) {
url = url.substring(0, queryQuestionMarkIdx);
}
const fragmentHashIdx = url.indexOf('#');
if (fragmentHashIdx > -1) {
url = url.substring(0, fragmentHashIdx);
}
return url;
}
/** Returns the URI of the extension content script. */
export function getContentScriptUri() {
const url = stripUrlQueryParamsAndFragment(window.location.href);
return 'angular-devtools-content-script-' + url;
}
/** Returns the URI of the extension backend. */
export function getBackendUri() {
const url = stripUrlQueryParamsAndFragment(window.location.href);
return 'angular-devtools-backend-' + url;
}
/** Returns the URI of the Angular detection script. */
export function getDetectAngularScriptUri() {
const url = stripUrlQueryParamsAndFragment(window.location.href);
return 'angular-devtools-detect-angular-' + url;
}
export function stringifyAndEscape(obj: unknown): string {
return JSON.stringify(JSON.stringify(obj));
}