chrome-devtools-frontend 1.0.1539728 → 1.0.1541169
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/eslint.config.mjs +167 -151
- package/front_end/core/common/Debouncer.ts +2 -2
- package/front_end/core/common/Gzip.ts +1 -1
- package/front_end/core/common/Revealer.ts +5 -0
- package/front_end/core/common/Throttler.ts +3 -3
- package/front_end/core/host/GdpClient.ts +4 -0
- package/front_end/core/host/InspectorFrontendHost.ts +10 -10
- package/front_end/core/protocol_client/DevToolsCDPConnection.ts +181 -0
- package/front_end/core/protocol_client/InspectorBackend.ts +36 -203
- package/front_end/core/protocol_client/protocol_client.ts +2 -2
- package/front_end/core/sdk/DebuggerModel.ts +3 -16
- package/front_end/core/sdk/NetworkManager.ts +16 -11
- package/front_end/core/sdk/RemoteObject.ts +4 -0
- package/front_end/core/sdk/Target.ts +3 -6
- package/front_end/core/sdk/TargetManager.ts +1 -2
- package/front_end/core/sdk/sdk-meta.ts +0 -35
- package/front_end/entrypoints/lighthouse_worker/LighthouseWorkerService.ts +1 -3
- package/front_end/entrypoints/node_app/app/NodeMain.ts +3 -2
- package/front_end/entrypoints/shell/shell.ts +1 -0
- package/front_end/entrypoints/trace_app/trace_app.ts +1 -0
- package/front_end/generated/Deprecation.ts +8 -0
- package/front_end/generated/InspectorBackendCommands.ts +8 -5
- package/front_end/generated/SupportedCSSProperties.js +58 -4
- package/front_end/generated/protocol.ts +60 -4
- package/front_end/models/ai_assistance/EvaluateAction.ts +88 -5
- package/front_end/models/ai_assistance/data_formatters/PerformanceTraceFormatter.snapshot.txt +121 -56
- package/front_end/models/ai_assistance/data_formatters/PerformanceTraceFormatter.ts +104 -62
- package/front_end/models/ai_assistance/injected.ts +15 -2
- package/front_end/models/ai_assistance/performance/AIQueries.ts +56 -2
- package/front_end/{panels/issues → models/issues_manager}/IssueAggregator.ts +83 -65
- package/front_end/models/issues_manager/issues_manager.ts +2 -0
- package/front_end/models/live-metrics/web-vitals-injected/README.md +1 -1
- package/front_end/models/trace/Processor.ts +5 -4
- package/front_end/models/trace/Styles.ts +1 -1
- package/front_end/models/trace/insights/types.ts +1 -1
- package/front_end/models/trace/types/TraceEvents.ts +1 -1
- package/front_end/models/workspace/IgnoreListManager.ts +41 -47
- package/front_end/models/workspace/workspace-meta.ts +40 -0
- package/front_end/panels/ai_assistance/PatchWidget.ts +22 -12
- package/front_end/panels/ai_assistance/components/ChatView.ts +1 -1
- package/front_end/panels/animation/AnimationTimeline.ts +4 -4
- package/front_end/panels/animation/AnimationUI.ts +28 -34
- package/front_end/panels/common/AiCodeCompletionDisclaimer.ts +4 -4
- package/front_end/panels/common/AiCodeCompletionSummaryToolbar.ts +2 -2
- package/front_end/panels/elements/ElementsTreeElement.ts +37 -9
- package/front_end/panels/elements/LayoutPane.ts +2 -2
- package/front_end/panels/elements/PropertiesWidget.ts +3 -2
- package/front_end/panels/elements/components/AdornerManager.ts +9 -9
- package/front_end/panels/elements/layoutPane.css +5 -9
- package/front_end/panels/event_listeners/EventListenersView.ts +10 -6
- package/front_end/panels/explain/components/ConsoleInsight.ts +498 -449
- package/front_end/panels/issues/AffectedResourcesView.ts +3 -4
- package/front_end/panels/issues/CorsIssueDetailsView.ts +1 -2
- package/front_end/panels/issues/IssueView.ts +1 -1
- package/front_end/panels/issues/IssuesPane.ts +12 -15
- package/front_end/panels/issues/issues.ts +0 -2
- package/front_end/panels/lighthouse/LighthouseProtocolService.ts +3 -3
- package/front_end/panels/linear_memory_inspector/LinearMemoryInspectorController.ts +2 -2
- package/front_end/panels/network/NetworkDataGridNode.ts +2 -1
- package/front_end/panels/network/RequestConditionsDrawer.ts +149 -46
- package/front_end/panels/network/RequestPayloadView.ts +2 -1
- package/front_end/panels/network/RequestTimingView.ts +17 -10
- package/front_end/panels/network/components/RequestHeadersView.ts +24 -17
- package/front_end/panels/network/network-meta.ts +11 -0
- package/front_end/panels/protocol_monitor/JSONEditor.ts +2 -2
- package/front_end/panels/recorder/RecorderController.ts +6 -7
- package/front_end/panels/recorder/models/RecordingPlayer.ts +3 -3
- package/front_end/panels/settings/components/SyncSection.ts +1 -1
- package/front_end/panels/settings/emulation/components/userAgentClientHintsForm.css +1 -1
- package/front_end/panels/sources/BreakpointsView.ts +3 -3
- package/front_end/panels/sources/DebuggerPlugin.ts +1 -1
- package/front_end/panels/sources/ScopeChainSidebarPane.ts +4 -3
- package/front_end/panels/sources/WatchExpressionsSidebarPane.ts +4 -3
- package/front_end/panels/sources/breakpointsView.css +1 -1
- package/front_end/panels/sources/sourcesPanel.css +2 -2
- package/front_end/panels/timeline/TimelineFlameChartView.ts +3 -3
- package/front_end/panels/timeline/TimelinePanel.ts +3 -3
- package/front_end/panels/timeline/components/FieldSettingsDialog.ts +9 -5
- package/front_end/panels/timeline/components/LayoutShiftDetails.ts +16 -10
- package/front_end/panels/timeline/components/LiveMetricsView.ts +20 -9
- package/front_end/panels/timeline/components/MetricCard.ts +4 -2
- package/front_end/panels/timeline/components/SidebarSingleInsightSet.ts +2 -0
- package/front_end/services/puppeteer/PuppeteerConnection.ts +2 -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/api/Page.d.ts +5 -0
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/api/Page.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/api/Page.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/Page.d.ts +1 -0
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/Page.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/Page.js +3 -0
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/Page.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/Browser.d.ts +1 -0
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/Browser.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/Browser.js +21 -0
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/Browser.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/ExtensionTransport.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/ExtensionTransport.js +5 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/ExtensionTransport.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/Page.d.ts +1 -0
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/Page.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/Page.js +6 -0
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/Page.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/TargetManager.d.ts +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/TargetManager.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/TargetManager.js +29 -27
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/TargetManager.js.map +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/util/Mutex.d.ts +2 -2
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/util/version.d.ts +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/util/version.js +1 -1
- package/front_end/third_party/puppeteer/package/lib/es5-iife/puppeteer-core-browser.d.ts +5 -0
- package/front_end/third_party/puppeteer/package/lib/es5-iife/puppeteer-core-browser.js +61 -26
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/api/Page.d.ts +5 -0
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/api/Page.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/api/Page.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/Page.d.ts +1 -0
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/Page.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/Page.js +3 -0
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/Page.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/Browser.d.ts +1 -0
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/Browser.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/Browser.js +21 -0
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/Browser.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/ExtensionTransport.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/ExtensionTransport.js +5 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/ExtensionTransport.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/Page.d.ts +1 -0
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/Page.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/Page.js +6 -0
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/Page.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/TargetManager.d.ts +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/TargetManager.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/TargetManager.js +30 -28
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/TargetManager.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/util/version.d.ts +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/util/version.js +1 -1
- package/front_end/third_party/puppeteer/package/lib/types.d.ts +5 -0
- package/front_end/third_party/puppeteer/package/package.json +1 -1
- package/front_end/third_party/puppeteer/package/src/api/Page.ts +6 -0
- package/front_end/third_party/puppeteer/package/src/bidi/Page.ts +4 -0
- package/front_end/third_party/puppeteer/package/src/cdp/Browser.ts +32 -0
- package/front_end/third_party/puppeteer/package/src/cdp/ExtensionTransport.ts +5 -1
- package/front_end/third_party/puppeteer/package/src/cdp/Page.ts +8 -0
- package/front_end/third_party/puppeteer/package/src/cdp/TargetManager.ts +36 -43
- package/front_end/third_party/puppeteer/package/src/util/version.ts +1 -1
- package/front_end/ui/components/dialogs/ButtonDialog.ts +15 -5
- package/front_end/ui/components/expandable_list/ExpandableList.ts +1 -1
- package/front_end/ui/components/helpers/helpers.ts +0 -2
- package/front_end/ui/components/markdown_view/MarkdownView.ts +1 -0
- package/front_end/ui/components/menus/Menu.ts +5 -3
- package/front_end/ui/components/snackbars/Snackbars.docs.ts +46 -0
- package/front_end/ui/components/survey_link/SurveyLink.docs.ts +22 -0
- package/front_end/ui/components/tree_outline/TreeOutline.ts +1 -2
- package/front_end/ui/{components/docs/context_menu/basic.ts → legacy/ContextMenu.docs.ts} +58 -25
- package/front_end/ui/legacy/SelectMenu.docs.ts +14 -0
- package/front_end/ui/legacy/UIUtils.ts +2 -1
- package/front_end/ui/legacy/components/inline_editor/BezierEditor.ts +1 -1
- package/front_end/ui/legacy/components/object_ui/CustomPreviewComponent.ts +3 -1
- package/front_end/ui/legacy/components/object_ui/ObjectPropertiesSection.ts +558 -439
- package/front_end/ui/legacy/components/perf_ui/TimelineOverviewPane.ts +3 -3
- package/front_end/ui/legacy/components/perf_ui/pieChart.css +1 -1
- package/front_end/ui/legacy/components/utils/Linkifier.ts +1 -1
- package/front_end/ui/legacy/inspectorCommon.css +3 -2
- package/mcp/mcp.ts +15 -1
- package/package.json +2 -1
- package/front_end/core/protocol_client/NodeURL.ts +0 -40
- package/front_end/ui/components/docs/combo_box/basic.html +0 -20
- package/front_end/ui/components/docs/combo_box/basic.ts +0 -49
- package/front_end/ui/components/docs/context_menu/basic.html +0 -45
- package/front_end/ui/components/docs/legacy_color_invert/basic.html +0 -77
- package/front_end/ui/components/docs/legacy_color_invert/basic.ts +0 -98
- package/front_end/ui/components/docs/linkifier/simple-url.html +0 -25
- package/front_end/ui/components/docs/linkifier/simple-url.ts +0 -25
- package/front_end/ui/components/docs/panel_feedback/basic.html +0 -25
- package/front_end/ui/components/docs/panel_feedback/basic.ts +0 -21
- package/front_end/ui/components/docs/panel_feedback/button.html +0 -25
- package/front_end/ui/components/docs/panel_feedback/button.ts +0 -19
- package/front_end/ui/components/docs/panel_introduction_steps/basic.html +0 -25
- package/front_end/ui/components/docs/panel_introduction_steps/basic.ts +0 -28
- package/front_end/ui/components/docs/perf_piechart/basic-with-legend.html +0 -20
- package/front_end/ui/components/docs/perf_piechart/basic-with-legend.ts +0 -20
- package/front_end/ui/components/docs/perf_piechart/basic-without-legend.html +0 -20
- package/front_end/ui/components/docs/perf_piechart/basic-without-legend.ts +0 -18
- package/front_end/ui/components/docs/snackbars/basic.html +0 -17
- package/front_end/ui/components/docs/snackbars/basic.ts +0 -50
- package/front_end/ui/components/docs/survey_link/basic.html +0 -20
- package/front_end/ui/components/docs/survey_link/basic.ts +0 -28
- package/front_end/ui/components/docs/tree_outline/basic.html +0 -33
- package/front_end/ui/components/docs/tree_outline/basic.ts +0 -38
- package/front_end/ui/components/docs/tree_outline/custom-renderers.html +0 -32
- package/front_end/ui/components/docs/tree_outline/custom-renderers.ts +0 -61
- package/front_end/ui/components/docs/tree_outline/lazy-children.html +0 -32
- package/front_end/ui/components/docs/tree_outline/lazy-children.ts +0 -91
- package/front_end/ui/components/docs/tree_outline/sample-data.ts +0 -67
- package/front_end/ui/components/helpers/directives.ts +0 -38
|
@@ -35,6 +35,10 @@ export class AIQueries {
|
|
|
35
35
|
|
|
36
36
|
const threads = Trace.Handlers.Threads.threadsInTrace(parsedTrace.data);
|
|
37
37
|
const thread = threads.find(thread => {
|
|
38
|
+
if (!thread.processIsOnMainFrame) {
|
|
39
|
+
return false;
|
|
40
|
+
}
|
|
41
|
+
|
|
38
42
|
if (mainThreadPID && mainThreadTID) {
|
|
39
43
|
return thread.pid === mainThreadPID && thread.tid === mainThreadTID;
|
|
40
44
|
}
|
|
@@ -45,9 +49,9 @@ export class AIQueries {
|
|
|
45
49
|
}
|
|
46
50
|
|
|
47
51
|
/**
|
|
48
|
-
* Returns bottom up activity for the given range.
|
|
52
|
+
* Returns bottom up activity for the given range (within a single navigation / thread).
|
|
49
53
|
*/
|
|
50
|
-
static
|
|
54
|
+
static mainThreadActivityBottomUpSingleNavigation(
|
|
51
55
|
navigationId: string|undefined, bounds: Trace.Types.Timing.TraceWindowMicro,
|
|
52
56
|
parsedTrace: Trace.TraceModel.ParsedTrace): Trace.Extras.TraceTree.BottomUpRootNode|null {
|
|
53
57
|
const thread = this.findMainThread(navigationId, parsedTrace);
|
|
@@ -76,6 +80,56 @@ export class AIQueries {
|
|
|
76
80
|
});
|
|
77
81
|
}
|
|
78
82
|
|
|
83
|
+
/**
|
|
84
|
+
* Returns bottom up activity for the given range (no matter the navigation / thread).
|
|
85
|
+
*/
|
|
86
|
+
static mainThreadActivityBottomUp(
|
|
87
|
+
bounds: Trace.Types.Timing.TraceWindowMicro,
|
|
88
|
+
parsedTrace: Trace.TraceModel.ParsedTrace): Trace.Extras.TraceTree.BottomUpRootNode|null {
|
|
89
|
+
const threads: Trace.Handlers.Threads.ThreadData[] = [];
|
|
90
|
+
if (parsedTrace.insights) {
|
|
91
|
+
for (const insightSet of parsedTrace.insights?.values()) {
|
|
92
|
+
const thread = this.findMainThread(insightSet.navigation?.args.data?.navigationId, parsedTrace);
|
|
93
|
+
if (thread) {
|
|
94
|
+
threads.push(thread);
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
} else {
|
|
98
|
+
const navigationId = parsedTrace.data.Meta.mainFrameNavigations[0].args.data?.navigationId;
|
|
99
|
+
const thread = this.findMainThread(navigationId, parsedTrace);
|
|
100
|
+
if (thread) {
|
|
101
|
+
threads.push(thread);
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
if (threads.length === 0) {
|
|
106
|
+
return null;
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
const threadEvents =
|
|
110
|
+
[...new Set(threads)].map(thread => AICallTree.findEventsForThread({thread, parsedTrace, bounds}) ?? []);
|
|
111
|
+
const events = threadEvents.flat();
|
|
112
|
+
|
|
113
|
+
if (events.length === 0) {
|
|
114
|
+
return null;
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
// Use the same filtering as front_end/panels/timeline/TimelineTreeView.ts.
|
|
118
|
+
const visibleEvents = Trace.Helpers.Trace.VISIBLE_TRACE_EVENT_TYPES.values().toArray();
|
|
119
|
+
const filter = new Trace.Extras.TraceFilter.VisibleEventsFilter(
|
|
120
|
+
visibleEvents.concat([Trace.Types.Events.Name.SYNTHETIC_NETWORK_REQUEST]));
|
|
121
|
+
|
|
122
|
+
// The bottom up root node handles all the "in Tracebounds" checks we need for the insight.
|
|
123
|
+
const startTime = Trace.Helpers.Timing.microToMilli(bounds.min);
|
|
124
|
+
const endTime = Trace.Helpers.Timing.microToMilli(bounds.max);
|
|
125
|
+
return new Trace.Extras.TraceTree.BottomUpRootNode(events, {
|
|
126
|
+
textFilter: new Trace.Extras.TraceFilter.ExclusiveNameFilter([]),
|
|
127
|
+
filters: [filter],
|
|
128
|
+
startTime,
|
|
129
|
+
endTime,
|
|
130
|
+
});
|
|
131
|
+
}
|
|
132
|
+
|
|
79
133
|
/**
|
|
80
134
|
* Returns an AI Call Tree representing the activity on the main thread for
|
|
81
135
|
* the relevant time range of the given insight.
|
|
@@ -4,7 +4,29 @@
|
|
|
4
4
|
|
|
5
5
|
import * as Common from '../../core/common/common.js';
|
|
6
6
|
import type * as Protocol from '../../generated/protocol.js';
|
|
7
|
-
|
|
7
|
+
|
|
8
|
+
import {AttributionReportingIssue} from './AttributionReportingIssue.js';
|
|
9
|
+
import {ContentSecurityPolicyIssue} from './ContentSecurityPolicyIssue.js';
|
|
10
|
+
import {CookieDeprecationMetadataIssue} from './CookieDeprecationMetadataIssue.js';
|
|
11
|
+
import {CookieIssue} from './CookieIssue.js';
|
|
12
|
+
import {CorsIssue} from './CorsIssue.js';
|
|
13
|
+
import {DeprecationIssue} from './DeprecationIssue.js';
|
|
14
|
+
import {ElementAccessibilityIssue} from './ElementAccessibilityIssue.js';
|
|
15
|
+
import {GenericIssue} from './GenericIssue.js';
|
|
16
|
+
import {HeavyAdIssue} from './HeavyAdIssue.js';
|
|
17
|
+
import {Issue, IssueCategory, IssueKind, unionIssueKind} from './Issue.js';
|
|
18
|
+
import type {EventTypes as IssuesManagerEventsTypes, IssueAddedEvent} from './IssuesManager.js';
|
|
19
|
+
import {Events as IssuesManagerEvents} from './IssuesManagerEvents.js';
|
|
20
|
+
import {LowTextContrastIssue} from './LowTextContrastIssue.js';
|
|
21
|
+
import type {MarkdownIssueDescription} from './MarkdownIssueDescription.js';
|
|
22
|
+
import {MixedContentIssue} from './MixedContentIssue.js';
|
|
23
|
+
import {PartitioningBlobURLIssue} from './PartitioningBlobURLIssue.js';
|
|
24
|
+
import {QuirksModeIssue} from './QuirksModeIssue.js';
|
|
25
|
+
import {SharedArrayBufferIssue} from './SharedArrayBufferIssue.js';
|
|
26
|
+
|
|
27
|
+
export interface IssuesProvider extends Common.EventTarget.EventTarget<IssuesManagerEventsTypes> {
|
|
28
|
+
issues(): Iterable<Issue>;
|
|
29
|
+
}
|
|
8
30
|
|
|
9
31
|
interface AggregationKeyTag {
|
|
10
32
|
aggregationKeyTag: undefined;
|
|
@@ -24,7 +46,7 @@ export type AggregationKey = {
|
|
|
24
46
|
* Currently only grouping by issue code, is supported. The class provides helpers to support displaying
|
|
25
47
|
* of all resources that are affected by the aggregated issues.
|
|
26
48
|
*/
|
|
27
|
-
export class AggregatedIssue extends
|
|
49
|
+
export class AggregatedIssue extends Issue {
|
|
28
50
|
#affectedCookies = new Map<string, {
|
|
29
51
|
cookie: Protocol.Audits.AffectedCookie,
|
|
30
52
|
hasRequest: boolean,
|
|
@@ -33,24 +55,23 @@ export class AggregatedIssue extends IssuesManager.Issue.Issue {
|
|
|
33
55
|
#affectedRequests: Protocol.Audits.AffectedRequest[] = [];
|
|
34
56
|
#affectedRequestIds = new Set<Protocol.Network.RequestId>();
|
|
35
57
|
#affectedLocations = new Map<string, Protocol.Audits.SourceCodeLocation>();
|
|
36
|
-
#heavyAdIssues = new Set<
|
|
58
|
+
#heavyAdIssues = new Set<HeavyAdIssue>();
|
|
37
59
|
#blockedByResponseDetails = new Map<string, Protocol.Audits.BlockedByResponseIssueDetails>();
|
|
38
60
|
#bounceTrackingSites = new Set<string>();
|
|
39
|
-
#corsIssues = new Set<
|
|
40
|
-
#cspIssues = new Set<
|
|
41
|
-
#deprecationIssues = new Set<
|
|
42
|
-
#issueKind =
|
|
43
|
-
#lowContrastIssues = new Set<
|
|
44
|
-
#cookieDeprecationMetadataIssues =
|
|
45
|
-
|
|
46
|
-
#
|
|
47
|
-
#
|
|
48
|
-
#
|
|
49
|
-
#
|
|
50
|
-
#
|
|
51
|
-
#
|
|
52
|
-
#
|
|
53
|
-
#representative?: IssuesManager.Issue.Issue;
|
|
61
|
+
#corsIssues = new Set<CorsIssue>();
|
|
62
|
+
#cspIssues = new Set<ContentSecurityPolicyIssue>();
|
|
63
|
+
#deprecationIssues = new Set<DeprecationIssue>();
|
|
64
|
+
#issueKind = IssueKind.IMPROVEMENT;
|
|
65
|
+
#lowContrastIssues = new Set<LowTextContrastIssue>();
|
|
66
|
+
#cookieDeprecationMetadataIssues = new Set<CookieDeprecationMetadataIssue>();
|
|
67
|
+
#mixedContentIssues = new Set<MixedContentIssue>();
|
|
68
|
+
#partitioningBlobURLIssues = new Set<PartitioningBlobURLIssue>();
|
|
69
|
+
#sharedArrayBufferIssues = new Set<SharedArrayBufferIssue>();
|
|
70
|
+
#quirksModeIssues = new Set<QuirksModeIssue>();
|
|
71
|
+
#attributionReportingIssues = new Set<AttributionReportingIssue>();
|
|
72
|
+
#genericIssues = new Set<GenericIssue>();
|
|
73
|
+
#elementAccessibilityIssues = new Set<ElementAccessibilityIssue>();
|
|
74
|
+
#representative?: Issue;
|
|
54
75
|
#aggregatedIssuesCount = 0;
|
|
55
76
|
#key: AggregationKey;
|
|
56
77
|
|
|
@@ -94,32 +115,31 @@ export class AggregatedIssue extends IssuesManager.Issue.Issue {
|
|
|
94
115
|
return this.#affectedCookies.values();
|
|
95
116
|
}
|
|
96
117
|
|
|
97
|
-
getHeavyAdIssues(): Iterable<
|
|
118
|
+
getHeavyAdIssues(): Iterable<HeavyAdIssue> {
|
|
98
119
|
return this.#heavyAdIssues;
|
|
99
120
|
}
|
|
100
121
|
|
|
101
|
-
getCookieDeprecationMetadataIssues():
|
|
102
|
-
Iterable<IssuesManager.CookieDeprecationMetadataIssue.CookieDeprecationMetadataIssue> {
|
|
122
|
+
getCookieDeprecationMetadataIssues(): Iterable<CookieDeprecationMetadataIssue> {
|
|
103
123
|
return this.#cookieDeprecationMetadataIssues;
|
|
104
124
|
}
|
|
105
125
|
|
|
106
|
-
getMixedContentIssues(): Iterable<
|
|
126
|
+
getMixedContentIssues(): Iterable<MixedContentIssue> {
|
|
107
127
|
return this.#mixedContentIssues;
|
|
108
128
|
}
|
|
109
129
|
|
|
110
|
-
getCorsIssues(): Set<
|
|
130
|
+
getCorsIssues(): Set<CorsIssue> {
|
|
111
131
|
return this.#corsIssues;
|
|
112
132
|
}
|
|
113
133
|
|
|
114
|
-
getCspIssues(): Iterable<
|
|
134
|
+
getCspIssues(): Iterable<ContentSecurityPolicyIssue> {
|
|
115
135
|
return this.#cspIssues;
|
|
116
136
|
}
|
|
117
137
|
|
|
118
|
-
getDeprecationIssues(): Iterable<
|
|
138
|
+
getDeprecationIssues(): Iterable<DeprecationIssue> {
|
|
119
139
|
return this.#deprecationIssues;
|
|
120
140
|
}
|
|
121
141
|
|
|
122
|
-
getLowContrastIssues(): Iterable<
|
|
142
|
+
getLowContrastIssues(): Iterable<LowTextContrastIssue> {
|
|
123
143
|
return this.#lowContrastIssues;
|
|
124
144
|
}
|
|
125
145
|
|
|
@@ -127,45 +147,45 @@ export class AggregatedIssue extends IssuesManager.Issue.Issue {
|
|
|
127
147
|
return this.#affectedRequests.values();
|
|
128
148
|
}
|
|
129
149
|
|
|
130
|
-
getSharedArrayBufferIssues(): Iterable<
|
|
150
|
+
getSharedArrayBufferIssues(): Iterable<SharedArrayBufferIssue> {
|
|
131
151
|
return this.#sharedArrayBufferIssues;
|
|
132
152
|
}
|
|
133
153
|
|
|
134
|
-
getQuirksModeIssues(): Iterable<
|
|
154
|
+
getQuirksModeIssues(): Iterable<QuirksModeIssue> {
|
|
135
155
|
return this.#quirksModeIssues;
|
|
136
156
|
}
|
|
137
157
|
|
|
138
|
-
getAttributionReportingIssues(): ReadonlySet<
|
|
158
|
+
getAttributionReportingIssues(): ReadonlySet<AttributionReportingIssue> {
|
|
139
159
|
return this.#attributionReportingIssues;
|
|
140
160
|
}
|
|
141
161
|
|
|
142
|
-
getGenericIssues(): ReadonlySet<
|
|
162
|
+
getGenericIssues(): ReadonlySet<GenericIssue> {
|
|
143
163
|
return this.#genericIssues;
|
|
144
164
|
}
|
|
145
165
|
|
|
146
|
-
getElementAccessibilityIssues(): Iterable<
|
|
166
|
+
getElementAccessibilityIssues(): Iterable<ElementAccessibilityIssue> {
|
|
147
167
|
return this.#elementAccessibilityIssues;
|
|
148
168
|
}
|
|
149
169
|
|
|
150
|
-
getDescription():
|
|
170
|
+
getDescription(): MarkdownIssueDescription|null {
|
|
151
171
|
if (this.#representative) {
|
|
152
172
|
return this.#representative.getDescription();
|
|
153
173
|
}
|
|
154
174
|
return null;
|
|
155
175
|
}
|
|
156
176
|
|
|
157
|
-
getCategory():
|
|
177
|
+
getCategory(): IssueCategory {
|
|
158
178
|
if (this.#representative) {
|
|
159
179
|
return this.#representative.getCategory();
|
|
160
180
|
}
|
|
161
|
-
return
|
|
181
|
+
return IssueCategory.OTHER;
|
|
162
182
|
}
|
|
163
183
|
|
|
164
184
|
getAggregatedIssuesCount(): number {
|
|
165
185
|
return this.#aggregatedIssuesCount;
|
|
166
186
|
}
|
|
167
187
|
|
|
168
|
-
getPartitioningBlobURLIssues(): Iterable<
|
|
188
|
+
getPartitioningBlobURLIssues(): Iterable<PartitioningBlobURLIssue> {
|
|
169
189
|
return this.#partitioningBlobURLIssues;
|
|
170
190
|
}
|
|
171
191
|
|
|
@@ -178,12 +198,12 @@ export class AggregatedIssue extends IssuesManager.Issue.Issue {
|
|
|
178
198
|
return `${domain};${path};${name}`;
|
|
179
199
|
}
|
|
180
200
|
|
|
181
|
-
addInstance(issue:
|
|
201
|
+
addInstance(issue: Issue): void {
|
|
182
202
|
this.#aggregatedIssuesCount++;
|
|
183
203
|
if (!this.#representative) {
|
|
184
204
|
this.#representative = issue;
|
|
185
205
|
}
|
|
186
|
-
this.#issueKind =
|
|
206
|
+
this.#issueKind = unionIssueKind(this.#issueKind, issue.getKind());
|
|
187
207
|
let hasRequest = false;
|
|
188
208
|
for (const request of issue.requests()) {
|
|
189
209
|
const {requestId} = request;
|
|
@@ -217,52 +237,52 @@ export class AggregatedIssue extends IssuesManager.Issue.Issue {
|
|
|
217
237
|
this.#affectedLocations.set(key, location);
|
|
218
238
|
}
|
|
219
239
|
}
|
|
220
|
-
if (issue instanceof
|
|
240
|
+
if (issue instanceof CookieDeprecationMetadataIssue) {
|
|
221
241
|
this.#cookieDeprecationMetadataIssues.add(issue);
|
|
222
242
|
}
|
|
223
|
-
if (issue instanceof
|
|
243
|
+
if (issue instanceof MixedContentIssue) {
|
|
224
244
|
this.#mixedContentIssues.add(issue);
|
|
225
245
|
}
|
|
226
|
-
if (issue instanceof
|
|
246
|
+
if (issue instanceof HeavyAdIssue) {
|
|
227
247
|
this.#heavyAdIssues.add(issue);
|
|
228
248
|
}
|
|
229
249
|
for (const details of issue.getBlockedByResponseDetails()) {
|
|
230
250
|
const key = JSON.stringify(details, ['parentFrame', 'blockedFrame', 'requestId', 'frameId', 'reason', 'request']);
|
|
231
251
|
this.#blockedByResponseDetails.set(key, details);
|
|
232
252
|
}
|
|
233
|
-
if (issue instanceof
|
|
253
|
+
if (issue instanceof ContentSecurityPolicyIssue) {
|
|
234
254
|
this.#cspIssues.add(issue);
|
|
235
255
|
}
|
|
236
|
-
if (issue instanceof
|
|
256
|
+
if (issue instanceof DeprecationIssue) {
|
|
237
257
|
this.#deprecationIssues.add(issue);
|
|
238
258
|
}
|
|
239
|
-
if (issue instanceof
|
|
259
|
+
if (issue instanceof SharedArrayBufferIssue) {
|
|
240
260
|
this.#sharedArrayBufferIssues.add(issue);
|
|
241
261
|
}
|
|
242
|
-
if (issue instanceof
|
|
262
|
+
if (issue instanceof LowTextContrastIssue) {
|
|
243
263
|
this.#lowContrastIssues.add(issue);
|
|
244
264
|
}
|
|
245
|
-
if (issue instanceof
|
|
265
|
+
if (issue instanceof CorsIssue) {
|
|
246
266
|
this.#corsIssues.add(issue);
|
|
247
267
|
}
|
|
248
|
-
if (issue instanceof
|
|
268
|
+
if (issue instanceof QuirksModeIssue) {
|
|
249
269
|
this.#quirksModeIssues.add(issue);
|
|
250
270
|
}
|
|
251
|
-
if (issue instanceof
|
|
271
|
+
if (issue instanceof AttributionReportingIssue) {
|
|
252
272
|
this.#attributionReportingIssues.add(issue);
|
|
253
273
|
}
|
|
254
|
-
if (issue instanceof
|
|
274
|
+
if (issue instanceof GenericIssue) {
|
|
255
275
|
this.#genericIssues.add(issue);
|
|
256
276
|
}
|
|
257
|
-
if (issue instanceof
|
|
277
|
+
if (issue instanceof ElementAccessibilityIssue) {
|
|
258
278
|
this.#elementAccessibilityIssues.add(issue);
|
|
259
279
|
}
|
|
260
|
-
if (issue instanceof
|
|
280
|
+
if (issue instanceof PartitioningBlobURLIssue) {
|
|
261
281
|
this.#partitioningBlobURLIssues.add(issue);
|
|
262
282
|
}
|
|
263
283
|
}
|
|
264
284
|
|
|
265
|
-
getKind():
|
|
285
|
+
getKind(): IssueKind {
|
|
266
286
|
return this.#issueKind;
|
|
267
287
|
}
|
|
268
288
|
|
|
@@ -278,17 +298,16 @@ export class AggregatedIssue extends IssuesManager.Issue.Issue {
|
|
|
278
298
|
export class IssueAggregator extends Common.ObjectWrapper.ObjectWrapper<EventTypes> {
|
|
279
299
|
readonly #aggregatedIssuesByKey = new Map<AggregationKey, AggregatedIssue>();
|
|
280
300
|
readonly #hiddenAggregatedIssuesByKey = new Map<AggregationKey, AggregatedIssue>();
|
|
281
|
-
constructor(private readonly issuesManager:
|
|
301
|
+
constructor(private readonly issuesManager: IssuesProvider) {
|
|
282
302
|
super();
|
|
283
|
-
this.issuesManager.addEventListener(
|
|
284
|
-
this.issuesManager.addEventListener(
|
|
285
|
-
IssuesManager.IssuesManager.Events.FULL_UPDATE_REQUIRED, this.#onFullUpdateRequired, this);
|
|
303
|
+
this.issuesManager.addEventListener(IssuesManagerEvents.ISSUE_ADDED, this.#onIssueAdded, this);
|
|
304
|
+
this.issuesManager.addEventListener(IssuesManagerEvents.FULL_UPDATE_REQUIRED, this.#onFullUpdateRequired, this);
|
|
286
305
|
for (const issue of this.issuesManager.issues()) {
|
|
287
306
|
this.#aggregateIssue(issue);
|
|
288
307
|
}
|
|
289
308
|
}
|
|
290
309
|
|
|
291
|
-
#onIssueAdded(event: Common.EventTarget.EventTargetEvent<
|
|
310
|
+
#onIssueAdded(event: Common.EventTarget.EventTargetEvent<IssueAddedEvent>): void {
|
|
292
311
|
this.#aggregateIssue(event.data.issue);
|
|
293
312
|
}
|
|
294
313
|
|
|
@@ -301,8 +320,8 @@ export class IssueAggregator extends Common.ObjectWrapper.ObjectWrapper<EventTyp
|
|
|
301
320
|
this.dispatchEventToListeners(Events.FULL_UPDATE_REQUIRED);
|
|
302
321
|
}
|
|
303
322
|
|
|
304
|
-
#aggregateIssue(issue:
|
|
305
|
-
if (
|
|
323
|
+
#aggregateIssue(issue: Issue): AggregatedIssue|undefined {
|
|
324
|
+
if (CookieIssue.isThirdPartyCookiePhaseoutRelatedIssue(issue)) {
|
|
306
325
|
return;
|
|
307
326
|
}
|
|
308
327
|
|
|
@@ -312,8 +331,7 @@ export class IssueAggregator extends Common.ObjectWrapper.ObjectWrapper<EventTyp
|
|
|
312
331
|
return aggregatedIssue;
|
|
313
332
|
}
|
|
314
333
|
|
|
315
|
-
#aggregateIssueByStatus(aggregatedIssuesMap: Map<AggregationKey, AggregatedIssue>, issue:
|
|
316
|
-
AggregatedIssue {
|
|
334
|
+
#aggregateIssueByStatus(aggregatedIssuesMap: Map<AggregationKey, AggregatedIssue>, issue: Issue): AggregatedIssue {
|
|
317
335
|
const key = issue.code() as unknown as AggregationKey;
|
|
318
336
|
let aggregatedIssue = aggregatedIssuesMap.get(key);
|
|
319
337
|
if (!aggregatedIssue) {
|
|
@@ -332,16 +350,16 @@ export class IssueAggregator extends Common.ObjectWrapper.ObjectWrapper<EventTyp
|
|
|
332
350
|
return new Set([...this.#aggregatedIssuesByKey.keys(), ...this.#hiddenAggregatedIssuesByKey.keys()]);
|
|
333
351
|
}
|
|
334
352
|
|
|
335
|
-
aggregatedIssueCategories(): Set<
|
|
336
|
-
const result = new Set<
|
|
353
|
+
aggregatedIssueCategories(): Set<IssueCategory> {
|
|
354
|
+
const result = new Set<IssueCategory>();
|
|
337
355
|
for (const issue of this.#aggregatedIssuesByKey.values()) {
|
|
338
356
|
result.add(issue.getCategory());
|
|
339
357
|
}
|
|
340
358
|
return result;
|
|
341
359
|
}
|
|
342
360
|
|
|
343
|
-
aggregatedIssueKinds(): Set<
|
|
344
|
-
const result = new Set<
|
|
361
|
+
aggregatedIssueKinds(): Set<IssueKind> {
|
|
362
|
+
const result = new Set<IssueKind>();
|
|
345
363
|
for (const issue of this.#aggregatedIssuesByKey.values()) {
|
|
346
364
|
result.add(issue.getKind());
|
|
347
365
|
}
|
|
@@ -356,7 +374,7 @@ export class IssueAggregator extends Common.ObjectWrapper.ObjectWrapper<EventTyp
|
|
|
356
374
|
return this.#hiddenAggregatedIssuesByKey.size;
|
|
357
375
|
}
|
|
358
376
|
|
|
359
|
-
keyForIssue(issue:
|
|
377
|
+
keyForIssue(issue: Issue<string>): AggregationKey {
|
|
360
378
|
return issue.code() as unknown as AggregationKey;
|
|
361
379
|
}
|
|
362
380
|
}
|
|
@@ -17,6 +17,7 @@ import * as FederatedAuthUserInfoRequestIssue from './FederatedAuthUserInfoReque
|
|
|
17
17
|
import * as GenericIssue from './GenericIssue.js';
|
|
18
18
|
import * as HeavyAdIssue from './HeavyAdIssue.js';
|
|
19
19
|
import * as Issue from './Issue.js';
|
|
20
|
+
import * as IssueAggregator from './IssueAggregator.js';
|
|
20
21
|
import * as IssueResolver from './IssueResolver.js';
|
|
21
22
|
import * as IssuesManager from './IssuesManager.js';
|
|
22
23
|
import * as LowTextContrastIssue from './LowTextContrastIssue.js';
|
|
@@ -49,6 +50,7 @@ export {
|
|
|
49
50
|
GenericIssue,
|
|
50
51
|
HeavyAdIssue,
|
|
51
52
|
Issue,
|
|
53
|
+
IssueAggregator,
|
|
52
54
|
IssueResolver,
|
|
53
55
|
IssuesManager,
|
|
54
56
|
LowTextContrastIssue,
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
|
|
3
3
|
[`web-vitals`](https://github.com/GoogleChrome/web-vitals-extension) is a Google-maintained library that measures CWV metrics using their canonical definition. We use it to ensure we are using consistent implementations for measuring CWV across Google. It can also measure performance metrics of the current page *after* the they happen (See [`PerformanceObserver` buffered setting](https://developer.mozilla.org/en-US/docs/Web/API/PerformanceObserver/observe#buffered)). See [go/cpq:rpp-metric-observations](http://go/cpq:rpp-metric-observations) for more information.
|
|
4
4
|
|
|
5
|
-
The web-vitals library needs to be run in the target page (although it can be used in an isolated execution context). We therefore need to create a JS binary that can be injected via `Page.evaluate`/`Page.addScriptToEvaluateOnNewDocument`. See `BUILD.gn` and `rollup.config.
|
|
5
|
+
The web-vitals library needs to be run in the target page (although it can be used in an isolated execution context). We therefore need to create a JS binary that can be injected via `Page.evaluate`/`Page.addScriptToEvaluateOnNewDocument`. See `BUILD.gn` and `rollup.config.mjs` for how we bundle the JS binary.
|
|
@@ -431,9 +431,13 @@ export class TraceProcessor extends EventTarget {
|
|
|
431
431
|
#computeInsightSet(data: Handlers.Types.HandlerData, context: Insights.Types.InsightSetContext): void {
|
|
432
432
|
const logger = context.options.logger;
|
|
433
433
|
|
|
434
|
+
if (!this.#insights) {
|
|
435
|
+
this.#insights = new Map();
|
|
436
|
+
}
|
|
437
|
+
|
|
434
438
|
let id, urlString, navigation;
|
|
435
439
|
if (context.navigation) {
|
|
436
|
-
id =
|
|
440
|
+
id = `NAVIGATION_${this.#insights.size}`;
|
|
437
441
|
urlString = data.Meta.finalDisplayUrlByNavigationId.get(context.navigationId) ?? data.Meta.mainFrameURL;
|
|
438
442
|
navigation = context.navigation;
|
|
439
443
|
} else {
|
|
@@ -503,9 +507,6 @@ export class TraceProcessor extends EventTarget {
|
|
|
503
507
|
bounds: context.bounds,
|
|
504
508
|
model: insightSetModel,
|
|
505
509
|
};
|
|
506
|
-
if (!this.#insights) {
|
|
507
|
-
this.#insights = new Map();
|
|
508
|
-
}
|
|
509
510
|
this.#insights.set(insightSet.id, insightSet);
|
|
510
511
|
this.sortInsightSet(insightSet, context.options.metadata ?? null);
|
|
511
512
|
}
|
|
@@ -432,7 +432,7 @@ const UIStrings = {
|
|
|
432
432
|
/**
|
|
433
433
|
* @description Event category in the Performance panel for time spent to perform Garbage Collection for C++: https://chromium.googlesource.com/v8/v8/+/main/include/cppgc/README.md
|
|
434
434
|
*/
|
|
435
|
-
cppGc: '
|
|
435
|
+
cppGc: 'C++ GC',
|
|
436
436
|
/**
|
|
437
437
|
* @description Event category in the Performance panel for time spent to perform encryption
|
|
438
438
|
*/
|
|
@@ -110,7 +110,7 @@ export type PartialInsightModel<T> =
|
|
|
110
110
|
* navigation (or the end of the trace).
|
|
111
111
|
*/
|
|
112
112
|
export interface InsightSet {
|
|
113
|
-
/** If for a navigation, this is the
|
|
113
|
+
/** If for a navigation, this is of the form "NAVIGATION_(index)". Else it is Trace.Types.Events.NO_NAVIGATION. */
|
|
114
114
|
id: Types.Events.NavigationId;
|
|
115
115
|
/** The URL to show in the accordion list. */
|
|
116
116
|
url: URL;
|
|
@@ -1001,7 +1001,7 @@ export const NO_NAVIGATION = 'NO_NAVIGATION';
|
|
|
1001
1001
|
* portion of the trace for which we don't have any navigation event for (as it happeneded prior
|
|
1002
1002
|
* to the trace start).
|
|
1003
1003
|
*/
|
|
1004
|
-
export type NavigationId = string
|
|
1004
|
+
export type NavigationId = string;
|
|
1005
1005
|
|
|
1006
1006
|
/**
|
|
1007
1007
|
* This is a synthetic Layout shift cluster. The rawSourceEvent is the worst layout shift event
|