/
githubmirror
/
angular
Обзор
Документация
Войти
/
githubmirror
/
angular
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
main
devtools/projects/shell-browser/src/app/comm-utils.ts
38 строк
1 KB
Matthieu Riegler
fix(devtools): scope the message bus with URLs to prevent cross message interference
12 фев 2026, 01:38
12 фев 2026, 01:38
302ea2e
Код
Авторство
О чём код?
/** * @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; }