chrome-devtools-frontend 1.0.1518653 → 1.0.1519267
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/config/owner/COMMON_OWNERS +2 -2
- package/eslint.config.mjs +1 -0
- package/front_end/core/sdk/EnhancedTracesParser.ts +5 -5
- package/front_end/core/sdk/RehydratingConnection.snapshot.txt +211 -0
- package/front_end/core/sdk/TargetManager.ts +4 -0
- package/front_end/generated/SupportedCSSProperties.js +19 -4
- package/front_end/models/ai_assistance/agents/AiAgent.ts +57 -10
- package/front_end/models/ai_assistance/agents/PerformanceAgent.ts +4 -53
- package/front_end/models/ai_assistance/agents/StylingAgent.ts +0 -31
- package/front_end/models/ai_assistance/data_formatters/PerformanceInsightFormatter.ts +6 -0
- package/front_end/models/ai_assistance/performance/AIContext.ts +1 -1
- package/front_end/models/ai_code_completion/AiCodeCompletion.ts +5 -0
- package/front_end/models/badges/AiExplorerBadge.ts +19 -3
- package/front_end/models/badges/Badge.ts +2 -0
- package/front_end/models/badges/CodeWhispererBadge.ts +1 -0
- package/front_end/models/badges/DOMDetectiveBadge.ts +1 -0
- package/front_end/models/badges/SpeedsterBadge.ts +1 -0
- package/front_end/models/badges/StarterBadge.ts +1 -0
- package/front_end/models/badges/badges.ts +1 -0
- package/front_end/models/javascript_metadata/NativeFunctions.js +1 -1
- package/front_end/models/trace/EventsSerializer.ts +4 -3
- package/front_end/models/trace/handlers/UserInteractionsHandler.ts +101 -73
- package/front_end/models/trace/helpers/Timing.ts +1 -1
- package/front_end/panels/ai_assistance/AiAssistancePanel.ts +4 -1
- package/front_end/panels/ai_assistance/components/PerformanceAgentMarkdownRenderer.ts +16 -14
- package/front_end/panels/application/components/BounceTrackingMitigationsView.ts +2 -2
- package/front_end/panels/common/BadgeNotification.ts +3 -3
- package/front_end/panels/common/GdpSignUpDialog.ts +3 -4
- package/front_end/panels/css_overview/CSSOverviewCompletedView.ts +5 -5
- package/front_end/panels/recorder/components/RecordingView.ts +2 -2
- package/front_end/panels/search/SearchResultsPane.ts +157 -138
- package/front_end/panels/search/SearchView.ts +12 -9
- package/front_end/panels/search/searchResultsPane.css +9 -0
- package/front_end/panels/security/CookieControlsView.ts +2 -1
- package/front_end/panels/settings/AISettingsTab.ts +6 -3
- package/front_end/panels/settings/components/SyncSection.ts +23 -9
- package/front_end/panels/settings/emulation/components/UserAgentClientHintsForm.ts +1 -1
- package/front_end/panels/sources/AiCodeCompletionPlugin.ts +3 -0
- package/front_end/panels/sources/SourcesPanel.ts +1 -1
- package/front_end/panels/sources/sourcesView.css +6 -1
- package/front_end/panels/timeline/components/LayoutShiftDetails.ts +1 -1
- package/front_end/panels/timeline/components/NetworkRequestDetails.ts +1 -1
- package/front_end/panels/timeline/components/RelatedInsightChips.ts +1 -1
- package/front_end/panels/timeline/components/SidebarSingleInsightSet.ts +1 -1
- package/front_end/third_party/chromium/README.chromium +1 -1
- package/front_end/third_party/puppeteer/README.chromium +2 -2
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/core/Realm.d.ts +2 -2
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/generated/injected.d.ts +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/generated/injected.js +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/generated/version.d.ts +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/generated/version.js +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/injected/injected.d.ts +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/node/ChromeLauncher.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/node/ChromeLauncher.js +1 -0
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/node/ChromeLauncher.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/revisions.d.ts +3 -3
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/revisions.js +3 -3
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/revisions.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/util/Function.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/util/Function.js +16 -25
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/util/Function.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/util/Mutex.d.ts +2 -2
- package/front_end/third_party/puppeteer/package/lib/es5-iife/puppeteer-core-browser.js +19 -28
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/generated/injected.d.ts +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/generated/injected.js +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/generated/version.d.ts +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/generated/version.js +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/node/ChromeLauncher.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/node/ChromeLauncher.js +1 -0
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/node/ChromeLauncher.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/revisions.d.ts +3 -3
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/revisions.js +3 -3
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/revisions.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/util/Function.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/util/Function.js +16 -25
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/util/Function.js.map +1 -1
- package/front_end/third_party/puppeteer/package/package.json +10 -3
- package/front_end/third_party/puppeteer/package/src/generated/injected.ts +1 -1
- package/front_end/third_party/puppeteer/package/src/generated/version.ts +1 -1
- package/front_end/third_party/puppeteer/package/src/node/ChromeLauncher.ts +1 -0
- package/front_end/third_party/puppeteer/package/src/revisions.ts +3 -3
- package/front_end/third_party/puppeteer/package/src/util/Function.ts +22 -30
- package/front_end/ui/components/dialogs/Dialog.ts +1 -1
- package/front_end/ui/components/markdown_view/MarkdownImage.ts +4 -5
- package/front_end/ui/components/switch/SwitchImpl.ts +12 -1
- package/front_end/ui/components/text_editor/config.ts +16 -2
- package/front_end/ui/legacy/Treeoutline.ts +3 -1
- package/front_end/ui/legacy/components/source_frame/XMLView.ts +12 -11
- package/front_end/ui/lit/i18n-template.ts +5 -2
- package/front_end/ui/visual_logging/KnownContextValues.ts +9 -5
- package/package.json +1 -1
@@ -10,6 +10,7 @@ export class StarterBadge extends Badge {
|
|
10
10
|
override readonly name =
|
11
11
|
'profiles/me/awards/developers.google.com%2Fprofile%2Fbadges%2Factivity%2Fchrome-devtools%2Fchrome-devtools-user';
|
12
12
|
override readonly title = 'Chrome DevTools User';
|
13
|
+
override readonly jslogContext = 'chrome-devtools-user';
|
13
14
|
override readonly imageUri = STARTER_BADGE_IMAGE_URI;
|
14
15
|
|
15
16
|
// TODO(ergunsh): Add remaining non-trivial event definitions
|
@@ -39,7 +39,7 @@ export class EventsSerializer {
|
|
39
39
|
if (EventsSerializer.isLegacyTimelineFrameKey(eventValues)) {
|
40
40
|
const event = parsedTrace.data.Frames.frames.at(eventValues.rawIndex);
|
41
41
|
if (!event) {
|
42
|
-
throw new Error(`Could not find frame with index ${eventValues.rawIndex}`);
|
42
|
+
throw new Error(`Unknown trace event. Could not find frame with index ${eventValues.rawIndex}`);
|
43
43
|
}
|
44
44
|
return event;
|
45
45
|
}
|
@@ -48,7 +48,8 @@ export class EventsSerializer {
|
|
48
48
|
const syntheticEvents = Helpers.SyntheticEvents.SyntheticEventsManager.getActiveManager().getSyntheticTraces();
|
49
49
|
const syntheticEvent = syntheticEvents.at(eventValues.rawIndex);
|
50
50
|
if (!syntheticEvent) {
|
51
|
-
throw new Error(`Attempted to get a synthetic event from an unknown raw event index: ${
|
51
|
+
throw new Error(`Unknown trace event. Attempted to get a synthetic event from an unknown raw event index: ${
|
52
|
+
eventValues.rawIndex}`);
|
52
53
|
}
|
53
54
|
return syntheticEvent;
|
54
55
|
}
|
@@ -57,7 +58,7 @@ export class EventsSerializer {
|
|
57
58
|
const rawEvents = Helpers.SyntheticEvents.SyntheticEventsManager.getActiveManager().getRawTraceEvents();
|
58
59
|
return rawEvents[eventValues.rawIndex];
|
59
60
|
}
|
60
|
-
throw new Error(`Unknown trace event
|
61
|
+
throw new Error(`Unknown trace event. Serializable key values: ${(eventValues as unknown[]).join('-')}`);
|
61
62
|
}
|
62
63
|
|
63
64
|
static isProfileCallKey(key: Types.File.SerializableKeyValues): key is Types.File.ProfileCallKeyValues {
|
@@ -2,6 +2,7 @@
|
|
2
2
|
// Use of this source code is governed by a BSD-style license that can be
|
3
3
|
// found in the LICENSE file.
|
4
4
|
|
5
|
+
import * as Platform from '../../../core/platform/platform.js';
|
5
6
|
import * as Helpers from '../helpers/helpers.js';
|
6
7
|
import * as Types from '../types/types.js';
|
7
8
|
|
@@ -56,15 +57,15 @@ let longestInteractionEvent: Types.Events.SyntheticInteractionPair|null = null;
|
|
56
57
|
|
57
58
|
let interactionEvents: Types.Events.SyntheticInteractionPair[] = [];
|
58
59
|
let interactionEventsWithNoNesting: Types.Events.SyntheticInteractionPair[] = [];
|
59
|
-
let eventTimingEndEventsById = new Map<string, Types.Events.EventTimingEnd>();
|
60
60
|
let eventTimingStartEventsForInteractions: Types.Events.EventTimingBegin[] = [];
|
61
|
+
let eventTimingEndEventsForInteractions: Types.Events.EventTimingEnd[] = [];
|
61
62
|
|
62
63
|
export function reset(): void {
|
63
64
|
beginCommitCompositorFrameEvents = [];
|
64
65
|
parseMetaViewportEvents = [];
|
65
66
|
interactionEvents = [];
|
66
67
|
eventTimingStartEventsForInteractions = [];
|
67
|
-
|
68
|
+
eventTimingEndEventsForInteractions = [];
|
68
69
|
interactionEventsWithNoNesting = [];
|
69
70
|
longestInteractionEvent = null;
|
70
71
|
}
|
@@ -86,7 +87,7 @@ export function handleEvent(event: Types.Events.Event): void {
|
|
86
87
|
|
87
88
|
if (Types.Events.isEventTimingEnd(event)) {
|
88
89
|
// Store the end event; for each start event that is an interaction, we need the matching end event to calculate the duration correctly.
|
89
|
-
|
90
|
+
eventTimingEndEventsForInteractions.push(event);
|
90
91
|
}
|
91
92
|
|
92
93
|
// From this point on we want to find events that represent interactions.
|
@@ -167,9 +168,18 @@ export function categoryOfInteraction(interaction: Types.Events.SyntheticInterac
|
|
167
168
|
* =======B=[keyup]=====
|
168
169
|
* ====C=[pointerdown]=
|
169
170
|
* =D=[pointerup]=
|
171
|
+
*
|
172
|
+
* Additionally, this method will also maximise the processing duration of the
|
173
|
+
* events that we keep as non-nested. We want to make sure we give an accurate
|
174
|
+
* representation of main thread activity, so if we keep an event + hide its
|
175
|
+
* nested children, we set the top level event's processing start &
|
176
|
+
* processing end to be the earliest processing start & the latest processing
|
177
|
+
* end of its children. This ensures we report a more accurate main thread
|
178
|
+
* activity time which is important as we want developers to focus on fixing
|
179
|
+
* this.
|
170
180
|
**/
|
171
|
-
export function
|
172
|
-
readonly Types.Events.SyntheticInteractionPair[] {
|
181
|
+
export function removeNestedInteractionsAndSetProcessingTime(
|
182
|
+
interactions: readonly Types.Events.SyntheticInteractionPair[]): readonly Types.Events.SyntheticInteractionPair[] {
|
173
183
|
/**
|
174
184
|
* Because we nest events only that are in the same category, we store the
|
175
185
|
* longest event for a given end time by category.
|
@@ -257,77 +267,95 @@ function writeSyntheticTimespans(event: Types.Events.SyntheticInteractionPair):
|
|
257
267
|
export async function finalize(): Promise<void> {
|
258
268
|
const {navigationsByFrameId} = metaHandlerData();
|
259
269
|
|
260
|
-
|
261
|
-
|
262
|
-
|
263
|
-
|
264
|
-
|
265
|
-
|
266
|
-
|
267
|
-
|
268
|
-
|
269
|
-
|
270
|
-
|
271
|
-
|
272
|
-
|
273
|
-
|
274
|
-
|
275
|
-
|
276
|
-
|
277
|
-
|
278
|
-
|
279
|
-
|
280
|
-
|
281
|
-
|
282
|
-
|
283
|
-
|
284
|
-
|
285
|
-
|
286
|
-
|
287
|
-
|
288
|
-
|
289
|
-
|
290
|
-
|
291
|
-
|
292
|
-
|
293
|
-
|
294
|
-
|
295
|
-
|
296
|
-
|
297
|
-
|
298
|
-
|
299
|
-
|
300
|
-
|
301
|
-
|
302
|
-
|
303
|
-
|
304
|
-
|
305
|
-
|
306
|
-
|
307
|
-
|
308
|
-
|
309
|
-
|
310
|
-
|
311
|
-
|
312
|
-
|
313
|
-
|
314
|
-
|
315
|
-
|
316
|
-
|
317
|
-
|
270
|
+
const beginAndEndEvents = Platform.ArrayUtilities.mergeOrdered(
|
271
|
+
eventTimingStartEventsForInteractions, eventTimingEndEventsForInteractions,
|
272
|
+
Helpers.Trace.eventTimeComparator) as Types.Events.EventTimingBeginOrEnd[];
|
273
|
+
|
274
|
+
// Pair up the begin & end events and create synthetic user timing events.
|
275
|
+
const beginEventById = new Map<string, Types.Events.EventTimingBegin[]>();
|
276
|
+
for (const event of beginAndEndEvents) {
|
277
|
+
if (Types.Events.isEventTimingStart(event)) {
|
278
|
+
const forId = beginEventById.get(event.id) ?? [];
|
279
|
+
forId.push(event);
|
280
|
+
beginEventById.set(event.id, forId);
|
281
|
+
} else if (Types.Events.isEventTimingEnd(event)) {
|
282
|
+
const beginEvents = beginEventById.get(event.id) ?? [];
|
283
|
+
const beginEvent = beginEvents.pop();
|
284
|
+
if (!beginEvent) {
|
285
|
+
continue;
|
286
|
+
}
|
287
|
+
const {type, interactionId, timeStamp, processingStart, processingEnd} = beginEvent.args.data;
|
288
|
+
if (!type || !interactionId || !timeStamp || !processingStart || !processingEnd) {
|
289
|
+
// A valid interaction event that we care about has to have a type (e.g. pointerdown, keyup).
|
290
|
+
// We also need to ensure it has an interactionId and various timings. There are edge cases where these aren't included in the trace event.
|
291
|
+
continue;
|
292
|
+
}
|
293
|
+
// In the future we will add microsecond timestamps to the trace events…
|
294
|
+
// (See https://source.chromium.org/chromium/chromium/src/+/main:third_party/blink/renderer/core/timing/window_performance.cc;l=900-901;drc=b503c262e425eae59ced4a80d59d176ed07152c7 )
|
295
|
+
// …but until then we can use the millisecond precision values that are in
|
296
|
+
// the trace event. To adjust them to be relative to the event.ts and the
|
297
|
+
// trace timestamps, for both processingStart and processingEnd we subtract
|
298
|
+
// the event timestamp (NOT event.ts, but the timeStamp millisecond value
|
299
|
+
// emitted in args.data), and then add that value to the event.ts. This
|
300
|
+
// will give us a processingStart and processingEnd time in microseconds
|
301
|
+
// that is relative to event.ts, and can be used when drawing boxes.
|
302
|
+
// There is some inaccuracy here as we are converting milliseconds to
|
303
|
+
// microseconds, but it is good enough until the backend emits more
|
304
|
+
// accurate numbers.
|
305
|
+
const processingStartRelativeToTraceTime = Types.Timing.Micro(
|
306
|
+
Helpers.Timing.milliToMicro(processingStart) - Helpers.Timing.milliToMicro(timeStamp) + beginEvent.ts,
|
307
|
+
);
|
308
|
+
|
309
|
+
const processingEndRelativeToTraceTime = Types.Timing.Micro(
|
310
|
+
(Helpers.Timing.milliToMicro(processingEnd) - Helpers.Timing.milliToMicro(timeStamp)) + beginEvent.ts);
|
311
|
+
|
312
|
+
// Ultimate frameId fallback only needed for TSC, see comments in the type.
|
313
|
+
const frameId = beginEvent.args.frame ?? beginEvent.args.data.frame ?? '';
|
314
|
+
const navigation = Helpers.Trace.getNavigationForTraceEvent(beginEvent, frameId, navigationsByFrameId);
|
315
|
+
const navigationId = navigation?.args.data?.navigationId;
|
316
|
+
const interactionEvent =
|
317
|
+
Helpers.SyntheticEvents.SyntheticEventsManager.registerSyntheticEvent<Types.Events.SyntheticInteractionPair>({
|
318
|
+
// Use the start event to define the common fields.
|
319
|
+
rawSourceEvent: beginEvent,
|
320
|
+
cat: beginEvent.cat,
|
321
|
+
name: beginEvent.name,
|
322
|
+
pid: beginEvent.pid,
|
323
|
+
tid: beginEvent.tid,
|
324
|
+
ph: beginEvent.ph,
|
325
|
+
processingStart: processingStartRelativeToTraceTime,
|
326
|
+
processingEnd: processingEndRelativeToTraceTime,
|
327
|
+
// These will be set in writeSyntheticTimespans()
|
328
|
+
inputDelay: Types.Timing.Micro(-1),
|
329
|
+
mainThreadHandling: Types.Timing.Micro(-1),
|
330
|
+
presentationDelay: Types.Timing.Micro(-1),
|
331
|
+
args: {
|
332
|
+
data: {
|
333
|
+
beginEvent,
|
334
|
+
endEvent: event,
|
335
|
+
frame: frameId,
|
336
|
+
navigationId,
|
337
|
+
},
|
318
338
|
},
|
319
|
-
|
320
|
-
|
321
|
-
|
322
|
-
|
323
|
-
|
324
|
-
|
325
|
-
|
326
|
-
|
327
|
-
interactionEvents.push(interactionEvent);
|
339
|
+
ts: beginEvent.ts,
|
340
|
+
dur: Types.Timing.Micro(event.ts - beginEvent.ts),
|
341
|
+
type: beginEvent.args.data.type,
|
342
|
+
interactionId: beginEvent.args.data.interactionId,
|
343
|
+
});
|
344
|
+
writeSyntheticTimespans(interactionEvent);
|
345
|
+
interactionEvents.push(interactionEvent);
|
346
|
+
}
|
328
347
|
}
|
329
348
|
|
330
|
-
|
349
|
+
// Once we gather up all the interactions, we want to remove nested
|
350
|
+
// interactions. Interactions can be nested because one user action (e.g. a
|
351
|
+
// click) will cause a pointerdown, pointerup and click. But we don't want to
|
352
|
+
// fill the interactions track with lots of noise. To fix this, we go through
|
353
|
+
// all the events and remove any nested ones so on the timeline we focus the
|
354
|
+
// user on the most important events, which we define as the longest one. But
|
355
|
+
// this algorithm assumes the events are in ASC order, so we first sort the
|
356
|
+
// set of interactions.
|
357
|
+
Helpers.Trace.sortTraceEventsInPlace(interactionEvents);
|
358
|
+
interactionEventsWithNoNesting.push(...removeNestedInteractionsAndSetProcessingTime(interactionEvents));
|
331
359
|
|
332
360
|
// Pick the longest interactions from the set that were not nested, as we
|
333
361
|
// know those are the set of the largest interactions.
|
@@ -221,7 +221,7 @@ export function boundsIncludeTimeRange(data: BoundsIncludeTimeRange): boolean {
|
|
221
221
|
/** Checks to see if the event is within or overlaps the bounds */
|
222
222
|
export function eventIsInBounds(event: Types.Events.Event, bounds: Types.Timing.TraceWindowMicro): boolean {
|
223
223
|
const startTime = event.ts;
|
224
|
-
return startTime <= bounds.max && bounds.min
|
224
|
+
return startTime <= bounds.max && bounds.min < (startTime + (event.dur ?? 0));
|
225
225
|
}
|
226
226
|
|
227
227
|
export function timestampIsInBounds(bounds: Types.Timing.TraceWindowMicro, timestamp: Types.Timing.Micro): boolean {
|
@@ -12,6 +12,7 @@ import * as Root from '../../core/root/root.js';
|
|
12
12
|
import * as SDK from '../../core/sdk/sdk.js';
|
13
13
|
import * as Protocol from '../../generated/protocol.js';
|
14
14
|
import * as AiAssistanceModel from '../../models/ai_assistance/ai_assistance.js';
|
15
|
+
import * as Badges from '../../models/badges/badges.js';
|
15
16
|
import * as TextUtils from '../../models/text_utils/text_utils.js';
|
16
17
|
import * as Workspace from '../../models/workspace/workspace.js';
|
17
18
|
import * as Buttons from '../../ui/components/buttons/buttons.js';
|
@@ -1409,7 +1410,9 @@ export class AiAssistancePanel extends UI.Panel.Panel {
|
|
1409
1410
|
// invariants do not hold anymore.
|
1410
1411
|
throw new Error('cross-origin context data should not be included');
|
1411
1412
|
}
|
1412
|
-
|
1413
|
+
if (this.#conversation?.isEmpty) {
|
1414
|
+
Badges.UserBadges.instance().recordAction(Badges.BadgeAction.STARTED_AI_CONVERSATION);
|
1415
|
+
}
|
1413
1416
|
const image = isAiAssistanceMultimodalInputEnabled() ? imageInput : undefined;
|
1414
1417
|
const imageId = image ? crypto.randomUUID() : undefined;
|
1415
1418
|
const multimodalInput = image && imageId && multimodalInputType ? {
|
@@ -20,21 +20,23 @@ export class PerformanceAgentMarkdownRenderer extends MarkdownRendererWithCodeBl
|
|
20
20
|
override templateForToken(token: Marked.Marked.MarkedToken): Lit.TemplateResult|null {
|
21
21
|
if (token.type === 'link' && token.href.startsWith('#')) {
|
22
22
|
const event = this.lookupEvent(token.href.slice(1) as Trace.Types.File.SerializableKey);
|
23
|
-
if (event) {
|
24
|
-
|
25
|
-
let title = '';
|
26
|
-
if (Trace.Types.Events.isSyntheticNetworkRequest(event)) {
|
27
|
-
title = event.args.data.url;
|
28
|
-
} else {
|
29
|
-
label += ` (${event.name})`;
|
30
|
-
}
|
31
|
-
|
32
|
-
// eslint-disable-next-line rulesdir/no-a-tags-in-lit
|
33
|
-
return html`<a href="#" draggable=false .title=${title} @click=${(e: Event) => {
|
34
|
-
e.stopPropagation();
|
35
|
-
void Common.Revealer.reveal(new SDK.TraceObject.RevealableEvent(event));
|
36
|
-
}}>${label}</a>`;
|
23
|
+
if (!event) {
|
24
|
+
return html`${token.text}`;
|
37
25
|
}
|
26
|
+
|
27
|
+
let label = token.text;
|
28
|
+
let title = '';
|
29
|
+
if (Trace.Types.Events.isSyntheticNetworkRequest(event)) {
|
30
|
+
title = event.args.data.url;
|
31
|
+
} else {
|
32
|
+
label += ` (${event.name})`;
|
33
|
+
}
|
34
|
+
|
35
|
+
// eslint-disable-next-line rulesdir/no-a-tags-in-lit
|
36
|
+
return html`<a href="#" draggable=false .title=${title} @click=${(e: Event) => {
|
37
|
+
e.stopPropagation();
|
38
|
+
void Common.Revealer.reveal(new SDK.TraceObject.RevealableEvent(event));
|
39
|
+
}}>${label}</a>`;
|
38
40
|
}
|
39
41
|
|
40
42
|
return super.templateForToken(token);
|
@@ -146,9 +146,9 @@ export class BounceTrackingMitigationsView extends LegacyWrapper.LegacyWrapper.W
|
|
146
146
|
// clang-format on
|
147
147
|
}
|
148
148
|
|
149
|
-
#renderDeletedSitesOrNoSitesMessage(): Lit.
|
149
|
+
#renderDeletedSitesOrNoSitesMessage(): Lit.LitTemplate {
|
150
150
|
if (!this.#seenButtonClick) {
|
151
|
-
return
|
151
|
+
return Lit.nothing;
|
152
152
|
}
|
153
153
|
|
154
154
|
if (this.#trackingSites.length === 0) {
|
@@ -211,7 +211,7 @@ export class BadgeNotification extends UI.Widget.Widget {
|
|
211
211
|
this.#show({
|
212
212
|
message: i18nFormatString(
|
213
213
|
UIStrings.starterBadgeAwardMessageSettingDisabled, {PH1: badge.title, PH2: googleDeveloperProgramLink}),
|
214
|
-
jslogContext: badge.
|
214
|
+
jslogContext: badge.jslogContext,
|
215
215
|
actions: [
|
216
216
|
{
|
217
217
|
label: i18nString(UIStrings.remindMeLater),
|
@@ -240,7 +240,7 @@ export class BadgeNotification extends UI.Widget.Widget {
|
|
240
240
|
this.#show({
|
241
241
|
message: i18nFormatString(
|
242
242
|
UIStrings.starterBadgeAwardMessageNoGdpProfile, {PH1: badge.title, PH2: googleDeveloperProgramLink}),
|
243
|
-
jslogContext: badge.
|
243
|
+
jslogContext: badge.jslogContext,
|
244
244
|
actions: [
|
245
245
|
{
|
246
246
|
label: i18nString(UIStrings.remindMeLater),
|
@@ -270,7 +270,7 @@ export class BadgeNotification extends UI.Widget.Widget {
|
|
270
270
|
#presentActivityBasedBadge(badge: Badges.Badge): void {
|
271
271
|
this.#show({
|
272
272
|
message: i18nString(UIStrings.activityBasedBadgeAwardMessage, {PH1: badge.title}),
|
273
|
-
jslogContext: badge.
|
273
|
+
jslogContext: badge.jslogContext,
|
274
274
|
actions: [
|
275
275
|
{
|
276
276
|
label: i18nString(UIStrings.manageSettings),
|
@@ -14,7 +14,6 @@ import * as Snackbars from '../../ui/components/snackbars/snackbars.js';
|
|
14
14
|
import type * as Switch from '../../ui/components/switch/switch.js';
|
15
15
|
import * as UI from '../../ui/legacy/legacy.js';
|
16
16
|
import {html, render} from '../../ui/lit/lit.js';
|
17
|
-
import * as VisualLogging from '../../ui/visual_logging/visual_logging.js';
|
18
17
|
|
19
18
|
import styles from './gdpSignUpDialog.css.js';
|
20
19
|
|
@@ -114,7 +113,7 @@ export const DEFAULT_VIEW: View = (input, _output, target): void => {
|
|
114
113
|
render(
|
115
114
|
html`
|
116
115
|
<style>${styles}</style>
|
117
|
-
<div class="gdp-sign-up-dialog-header" role="img"
|
116
|
+
<div class="gdp-sign-up-dialog-header" role="img" aria-label="Google Developer Program"></div>
|
118
117
|
<div class="main-content">
|
119
118
|
<div class="section">
|
120
119
|
<div class="icon-container">
|
@@ -136,9 +135,9 @@ export const DEFAULT_VIEW: View = (input, _output, target): void => {
|
|
136
135
|
<div class="switch-container">
|
137
136
|
<devtools-switch
|
138
137
|
.checked=${input.keepMeUpdated}
|
138
|
+
.jslogContext=${'keep-me-updated'}
|
139
|
+
.label=${i18nString(UIStrings.keepUpdated)}
|
139
140
|
@switchchange=${(e: Switch.Switch.SwitchChangeEvent) => input.onKeepMeUpdatedChange(e.checked)}
|
140
|
-
jslog=${VisualLogging.toggle('keep-me-updated').track({ click: true })}
|
141
|
-
aria-label=${i18nString(UIStrings.keepUpdated)}
|
142
141
|
>
|
143
142
|
</devtools-switch>
|
144
143
|
</div>
|
@@ -15,7 +15,7 @@ import * as Geometry from '../../models/geometry/geometry.js';
|
|
15
15
|
import * as TextUtils from '../../models/text_utils/text_utils.js';
|
16
16
|
import * as Components from '../../ui/legacy/components/utils/utils.js';
|
17
17
|
import * as UI from '../../ui/legacy/legacy.js';
|
18
|
-
import {Directives, html, nothing, render, type TemplateResult} from '../../ui/lit/lit.js';
|
18
|
+
import {Directives, html, type LitTemplate, nothing, render, type TemplateResult} from '../../ui/lit/lit.js';
|
19
19
|
import * as VisualLogging from '../../ui/visual_logging/visual_logging.js';
|
20
20
|
|
21
21
|
import cssOverviewCompletedViewStyles from './cssOverviewCompletedView.css.js';
|
@@ -519,10 +519,10 @@ function renderContrastIssue(key: string, issues: ContrastIssue[]): TemplateResu
|
|
519
519
|
// clang-format on
|
520
520
|
}
|
521
521
|
|
522
|
-
function renderColor(section: string, color: string):
|
522
|
+
function renderColor(section: string, color: string): LitTemplate {
|
523
523
|
const borderColor = Common.Color.parse(color)?.asLegacyColor();
|
524
524
|
if (!borderColor) {
|
525
|
-
return
|
525
|
+
return nothing;
|
526
526
|
}
|
527
527
|
// clang-format off
|
528
528
|
return html`<li>
|
@@ -1006,9 +1006,9 @@ export class ElementDetailsView extends UI.Widget.Widget {
|
|
1006
1006
|
}
|
1007
1007
|
}
|
1008
1008
|
|
1009
|
-
function renderNode(data: PopulateNodesEventNodeTypes, link?: HTMLElement, showNode?: () => void):
|
1009
|
+
function renderNode(data: PopulateNodesEventNodeTypes, link?: HTMLElement, showNode?: () => void): LitTemplate {
|
1010
1010
|
if (!link) {
|
1011
|
-
return
|
1011
|
+
return nothing;
|
1012
1012
|
}
|
1013
1013
|
return html`
|
1014
1014
|
<td>
|
@@ -220,9 +220,9 @@ function renderSettings({
|
|
220
220
|
replayState,
|
221
221
|
onReplaySettingsKeydown,
|
222
222
|
onToggleReplaySettings
|
223
|
-
}: ViewInput): Lit.
|
223
|
+
}: ViewInput): Lit.LitTemplate {
|
224
224
|
if (!settings) {
|
225
|
-
return
|
225
|
+
return Lit.nothing;
|
226
226
|
}
|
227
227
|
const environmentFragments = [];
|
228
228
|
if (settings.viewportSettings) {
|