chrome-devtools-frontend 1.0.1512147 → 1.0.1512349
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/front_end/Images/src/ai-explorer-badge.svg +114 -0
- package/front_end/Images/src/code-whisperer-badge.svg +166 -0
- package/front_end/Images/src/devtools-user-badge.svg +129 -0
- package/front_end/Images/src/dom-detective-badge.svg +136 -0
- package/front_end/Images/src/speedster-badge.svg +166 -0
- package/front_end/core/host/GdpClient.ts +38 -2
- package/front_end/core/i18n/NumberFormatter.ts +7 -0
- package/front_end/models/ai_assistance/agents/PerformanceAgent.ts +3 -19
- package/front_end/models/ai_assistance/ai_assistance.ts +1 -1
- package/front_end/models/ai_assistance/data_formatters/NetworkRequestFormatter.ts +7 -6
- package/front_end/models/ai_assistance/data_formatters/PerformanceInsightFormatter.snapshot.txt +119 -119
- package/front_end/models/ai_assistance/data_formatters/PerformanceInsightFormatter.ts +43 -52
- package/front_end/models/ai_assistance/data_formatters/PerformanceTraceFormatter.snapshot.txt +100 -100
- package/front_end/models/ai_assistance/data_formatters/PerformanceTraceFormatter.ts +11 -17
- package/front_end/models/ai_assistance/data_formatters/UnitFormatters.ts +151 -0
- package/front_end/models/badges/Badge.ts +7 -4
- package/front_end/models/badges/DOMDetectiveBadge.ts +20 -0
- package/front_end/models/badges/SpeedsterBadge.ts +4 -1
- package/front_end/models/badges/StarterBadge.ts +5 -1
- package/front_end/models/badges/UserBadges.ts +33 -7
- package/front_end/models/trace/ModelImpl.ts +0 -13
- package/front_end/panels/common/BadgeNotification.ts +119 -9
- package/front_end/panels/common/badgeNotification.css +4 -0
- package/front_end/panels/elements/ElementsTreeElement.ts +12 -0
- package/front_end/panels/elements/ElementsTreeOutline.ts +3 -0
- package/front_end/panels/elements/StylePropertiesSection.ts +3 -0
- package/front_end/panels/elements/StylePropertyTreeElement.ts +5 -0
- package/front_end/panels/settings/SettingsScreen.ts +3 -9
- package/front_end/panels/settings/components/SyncSection.ts +6 -2
- package/front_end/panels/timeline/TimelinePanel.ts +21 -9
- package/front_end/panels/timeline/TimelineUIUtils.ts +4 -3
- package/front_end/ui/legacy/filter.css +1 -1
- package/front_end/ui/legacy/inspectorCommon.css +1 -1
- package/front_end/ui/legacy/softDropDownButton.css +1 -1
- package/package.json +1 -1
- package/front_end/models/ai_assistance/data_formatters/Types.ts +0 -9
@@ -117,7 +117,6 @@ export interface SyncSectionData {
|
|
117
117
|
syncInfo: Host.InspectorFrontendHostAPI.SyncInformation;
|
118
118
|
syncSetting: Common.Settings.Setting<boolean>;
|
119
119
|
receiveBadgesSetting: Common.Settings.Setting<boolean>;
|
120
|
-
gdpProfile?: Host.GdpClient.Profile;
|
121
120
|
}
|
122
121
|
|
123
122
|
export class SyncSection extends HTMLElement {
|
@@ -132,7 +131,7 @@ export class SyncSection extends HTMLElement {
|
|
132
131
|
this.#syncInfo = data.syncInfo;
|
133
132
|
this.#syncSetting = data.syncSetting;
|
134
133
|
this.#receiveBadgesSetting = data.receiveBadgesSetting;
|
135
|
-
this.#
|
134
|
+
void this.#updateGdpProfile();
|
136
135
|
void ComponentHelpers.ScheduledRender.scheduleRender(this, this.#render);
|
137
136
|
}
|
138
137
|
|
@@ -157,6 +156,11 @@ export class SyncSection extends HTMLElement {
|
|
157
156
|
`, this.#shadow, {host: this});
|
158
157
|
// clang-format on
|
159
158
|
}
|
159
|
+
|
160
|
+
async #updateGdpProfile(): Promise<void> {
|
161
|
+
this.#gdpProfile = await Host.GdpClient.GdpClient.instance().getProfile() ?? undefined;
|
162
|
+
void ComponentHelpers.ScheduledRender.scheduleRender(this, this.#render);
|
163
|
+
}
|
160
164
|
}
|
161
165
|
|
162
166
|
function renderSettingCheckboxIfNeeded(
|
@@ -2733,14 +2733,27 @@ export class TimelinePanel extends Common.ObjectWrapper.eventMixin<EventTypes, t
|
|
2733
2733
|
async #executeNewTrace(
|
2734
2734
|
collectedEvents: Trace.Types.Events.Event[], isFreshRecording: boolean,
|
2735
2735
|
metadata: Trace.Types.File.MetaData|null): Promise<void> {
|
2736
|
-
|
2737
|
-
|
2738
|
-
|
2739
|
-
|
2740
|
-
|
2741
|
-
|
2736
|
+
const config: Trace.Types.Configuration.ParseOptions = {
|
2737
|
+
metadata: metadata ?? undefined,
|
2738
|
+
isFreshRecording,
|
2739
|
+
resolveSourceMap: this.#createSourceMapResolver(isFreshRecording, metadata),
|
2740
|
+
};
|
2741
|
+
|
2742
|
+
if (window.location.href.includes('devtools/bundled') || window.location.search.includes('debugFrontend')) {
|
2743
|
+
// Someone is debugging DevTools, enable the logger to give timings
|
2744
|
+
// when tracing the performance panel itself.
|
2745
|
+
const times: Record<string, number> = {};
|
2746
|
+
config.logger = {
|
2747
|
+
start(id) {
|
2748
|
+
times[id] = performance.now();
|
2742
2749
|
},
|
2743
|
-
|
2750
|
+
end(id) {
|
2751
|
+
performance.measure(id, {start: times[id]});
|
2752
|
+
},
|
2753
|
+
};
|
2754
|
+
}
|
2755
|
+
|
2756
|
+
await this.#traceEngineModel.parse(collectedEvents, config);
|
2744
2757
|
|
2745
2758
|
// Store all source maps on the trace metadata.
|
2746
2759
|
// If not fresh, we can't validate the maps are still accurate.
|
@@ -3039,8 +3052,7 @@ export class TimelinePanel extends Common.ObjectWrapper.eventMixin<EventTypes, t
|
|
3039
3052
|
for (const modelName in insightsForNav.model) {
|
3040
3053
|
const model = modelName as keyof Trace.Insights.Types.InsightModelsType;
|
3041
3054
|
const insight = insightsForNav.model[model];
|
3042
|
-
const formatter = new AiAssistanceModel.PerformanceInsightFormatter(
|
3043
|
-
AiAssistanceModel.PERF_AGENT_UNIT_FORMATTERS, parsedTrace, insight);
|
3055
|
+
const formatter = new AiAssistanceModel.PerformanceInsightFormatter(parsedTrace, insight);
|
3044
3056
|
if (!formatter.insightIsSupported()) {
|
3045
3057
|
// Not all Insights are integrated with "Ask AI" yet, let's avoid
|
3046
3058
|
// filling up the response with those ones because there will be no
|
@@ -476,6 +476,9 @@ const UIStrings = {
|
|
476
476
|
const str_ = i18n.i18n.registerUIStrings('panels/timeline/TimelineUIUtils.ts', UIStrings);
|
477
477
|
const i18nString = i18n.i18n.getLocalizedString.bind(undefined, str_);
|
478
478
|
|
479
|
+
// Look for scheme:// plus text and exclude any punctuation at the end.
|
480
|
+
export const URL_REGEX = /(?:[a-zA-Z][a-zA-Z0-9+.-]{2,}:\/\/)[^\s"]{2,}[^\s"'\)\}\],:;.!?]/u;
|
481
|
+
|
479
482
|
let eventDispatchDesciptors: EventDispatchTypeDescriptor[];
|
480
483
|
|
481
484
|
let colorGenerator: Common.Color.Generator;
|
@@ -897,9 +900,7 @@ export class TimelineUIUtils {
|
|
897
900
|
* of the link is the URL, so the visible string to the user is unchanged.
|
898
901
|
*/
|
899
902
|
static parseStringForLinks(rawString: string): DocumentFragment {
|
900
|
-
|
901
|
-
const urlRegex = /(?:[a-zA-Z][a-zA-Z0-9+.-]{2,}:\/\/)[^\s"]{2,}[^\s"'\)\}\],:;.!?]/u;
|
902
|
-
const results = TextUtils.TextUtils.Utils.splitStringByRegexes(rawString, [urlRegex]);
|
903
|
+
const results = TextUtils.TextUtils.Utils.splitStringByRegexes(rawString, [URL_REGEX]);
|
903
904
|
const nodes = results.map(result => {
|
904
905
|
if (result.regexIndex === -1) {
|
905
906
|
return result.value;
|
package/package.json
CHANGED
@@ -1,9 +0,0 @@
|
|
1
|
-
// Copyright 2025 The Chromium Authors
|
2
|
-
// Use of this source code is governed by a BSD-style license that can be
|
3
|
-
// found in the LICENSE file.
|
4
|
-
|
5
|
-
export interface UnitFormatters {
|
6
|
-
millis: (x: number) => string;
|
7
|
-
micros: (x: number) => string;
|
8
|
-
bytes: (x: number) => string;
|
9
|
-
}
|