chrome-devtools-frontend 1.0.951864 → 1.0.952784
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/gni/devtools_grd_files.gni +3 -0
- package/front_end/.eslintrc.js +6 -0
- package/front_end/core/host/UserMetrics.ts +2 -1
- package/front_end/core/i18n/locales/en-US.json +3 -0
- package/front_end/core/i18n/locales/en-XL.json +3 -0
- package/front_end/core/root/Runtime.ts +4 -12
- package/front_end/core/sdk/PageResourceLoader.ts +2 -1
- package/front_end/entrypoints/formatter_worker/AcornTokenizer.ts +39 -39
- package/front_end/entrypoints/formatter_worker/CSSFormatter.ts +54 -54
- package/front_end/entrypoints/formatter_worker/ESTreeWalker.ts +20 -20
- package/front_end/entrypoints/formatter_worker/FormattedContentBuilder.ts +54 -54
- package/front_end/entrypoints/formatter_worker/HTMLFormatter.ts +145 -144
- package/front_end/entrypoints/formatter_worker/JavaScriptFormatter.ts +40 -40
- package/front_end/entrypoints/heap_snapshot_worker/AllocationProfile.ts +64 -69
- package/front_end/entrypoints/heap_snapshot_worker/HeapSnapshot.ts +202 -200
- package/front_end/entrypoints/heap_snapshot_worker/HeapSnapshotLoader.ts +109 -108
- package/front_end/entrypoints/heap_snapshot_worker/HeapSnapshotWorkerDispatcher.ts +17 -17
- package/front_end/entrypoints/inspector_main/InspectorMain.ts +30 -30
- package/front_end/entrypoints/inspector_main/RenderingOptions.ts +25 -25
- package/front_end/entrypoints/main/ExecutionContextSelector.ts +52 -55
- package/front_end/entrypoints/main/MainImpl.ts +49 -49
- package/front_end/entrypoints/node_app/NodeConnectionsPanel.ts +43 -43
- package/front_end/entrypoints/node_app/NodeMain.ts +38 -38
- package/front_end/generated/InspectorBackendCommands.js +5 -1
- package/front_end/generated/protocol.d.ts +16 -0
- package/front_end/legacy/legacy-defs.d.ts +0 -21
- package/front_end/models/heap_snapshot_model/HeapSnapshotModel.ts +1 -1
- package/front_end/models/issues_manager/ClientHintIssue.ts +95 -0
- package/front_end/models/issues_manager/ContentSecurityPolicyIssue.ts +6 -6
- package/front_end/models/issues_manager/ContrastCheckTrigger.ts +15 -15
- package/front_end/models/issues_manager/CorsIssue.ts +9 -9
- package/front_end/models/issues_manager/CrossOriginEmbedderPolicyIssue.ts +5 -5
- package/front_end/models/issues_manager/DeprecationIssue.ts +7 -7
- package/front_end/models/issues_manager/GenericIssue.ts +5 -5
- package/front_end/models/issues_manager/HeavyAdIssue.ts +5 -5
- package/front_end/models/issues_manager/Issue.ts +10 -10
- package/front_end/models/issues_manager/IssueResolver.ts +11 -10
- package/front_end/models/issues_manager/IssuesManager.ts +61 -56
- package/front_end/models/issues_manager/LowTextContrastIssue.ts +4 -4
- package/front_end/models/issues_manager/MixedContentIssue.ts +7 -7
- package/front_end/models/issues_manager/NavigatorUserAgentIssue.ts +7 -7
- package/front_end/models/issues_manager/QuirksModeIssue.ts +4 -4
- package/front_end/models/issues_manager/SameSiteCookieIssue.ts +16 -16
- package/front_end/models/issues_manager/SharedArrayBufferIssue.ts +5 -5
- package/front_end/models/issues_manager/SourceFrameIssuesManager.ts +32 -31
- package/front_end/models/issues_manager/TrustedWebActivityIssue.ts +5 -5
- package/front_end/models/issues_manager/WasmCrossOriginModuleSharingIssue.ts +5 -5
- package/front_end/models/issues_manager/descriptions/clientHintMetaTagAllowListInvalidOrigin.md +4 -0
- package/front_end/models/issues_manager/descriptions/clientHintMetaTagModifiedHTML.md +4 -0
- package/front_end/models/issues_manager/issues_manager.ts +2 -0
- package/front_end/panels/application/components/BackForwardCacheView.ts +33 -33
- package/front_end/panels/application/components/EndpointsGrid.ts +12 -12
- package/front_end/panels/application/components/FrameDetailsView.ts +108 -110
- package/front_end/panels/application/components/OriginTrialTreeView.ts +45 -45
- package/front_end/panels/application/components/PermissionsPolicySection.ts +19 -19
- package/front_end/panels/application/components/ReportsGrid.ts +30 -30
- package/front_end/panels/application/components/StackTrace.ts +48 -47
- package/front_end/panels/application/components/TrustTokensView.ts +31 -31
- package/front_end/panels/console/ConsoleView.ts +1 -1
- package/front_end/panels/css_overview/CSSOverviewCompletedView.ts +41 -52
- package/front_end/panels/css_overview/CSSOverviewController.ts +2 -2
- package/front_end/panels/css_overview/CSSOverviewPanel.ts +18 -27
- package/front_end/panels/css_overview/CSSOverviewProcessingView.ts +2 -2
- package/front_end/panels/css_overview/CSSOverviewSidebarPanel.ts +6 -6
- package/front_end/panels/css_overview/components/CSSOverviewStartView.ts +4 -4
- package/front_end/panels/elements/components/AccessibilityTreeNode.ts +17 -17
- package/front_end/panels/elements/components/AdornerManager.ts +21 -21
- package/front_end/panels/elements/components/AdornerSettingsPane.ts +14 -14
- package/front_end/panels/elements/components/CSSQuery.ts +16 -16
- package/front_end/panels/elements/components/ComputedStyleProperty.ts +14 -14
- package/front_end/panels/elements/components/ComputedStyleTrace.ts +15 -15
- package/front_end/panels/elements/components/ElementsBreadcrumbs.ts +78 -78
- package/front_end/panels/elements/components/ElementsPanelLink.ts +16 -16
- package/front_end/panels/elements/components/LayoutPane.ts +47 -47
- package/front_end/panels/elements/components/NodeText.ts +18 -18
- package/front_end/panels/elements/components/QueryContainer.ts +40 -40
- package/front_end/panels/elements/components/StylePropertyEditor.ts +18 -18
- package/front_end/panels/emulation/components/DeviceSizeInputElement.ts +4 -4
- package/front_end/panels/issues/AffectedBlockedByResponseView.ts +4 -4
- package/front_end/panels/issues/AffectedCookiesView.ts +4 -5
- package/front_end/panels/issues/AffectedDirectivesView.ts +19 -19
- package/front_end/panels/issues/AffectedDocumentsInQuirksModeView.ts +7 -8
- package/front_end/panels/issues/AffectedElementsView.ts +4 -4
- package/front_end/panels/issues/AffectedElementsWithLowContrastView.ts +7 -8
- package/front_end/panels/issues/AffectedHeavyAdView.ts +8 -8
- package/front_end/panels/issues/AffectedResourcesView.ts +25 -26
- package/front_end/panels/issues/AffectedSharedArrayBufferIssueDetailsView.ts +8 -8
- package/front_end/panels/issues/AffectedSourcesView.ts +4 -4
- package/front_end/panels/issues/AffectedTrustedWebActivityIssueDetailsView.ts +4 -4
- package/front_end/panels/issues/AttributionReportingIssueDetailsView.ts +17 -17
- package/front_end/panels/issues/CSPViolationsListView.ts +22 -23
- package/front_end/panels/issues/CSPViolationsView.ts +17 -17
- package/front_end/panels/issues/ComboBoxOfCheckBoxes.ts +13 -13
- package/front_end/panels/issues/CorsIssueDetailsView.ts +23 -23
- package/front_end/panels/issues/GenericIssueDetailsView.ts +4 -4
- package/front_end/panels/issues/HiddenIssuesRow.ts +7 -7
- package/front_end/panels/issues/IssueAggregator.ts +95 -95
- package/front_end/panels/issues/IssueKindView.ts +14 -14
- package/front_end/panels/issues/IssueView.ts +98 -98
- package/front_end/panels/issues/IssuesPane.ts +102 -102
- package/front_end/panels/issues/WasmCrossOriginModuleSharingAffectedResourcesView.ts +5 -5
- package/front_end/panels/issues/components/HideIssuesMenu.ts +10 -10
- package/front_end/panels/media/PlayerListView.ts +160 -97
- package/front_end/panels/media/PlayerMessagesView.ts +1 -0
- package/front_end/panels/media/playerListView.css +58 -0
- package/front_end/panels/network/NetworkLogView.ts +2 -6
- package/front_end/panels/network/NetworkWaterfallColumn.ts +2 -4
- package/front_end/panels/network/components/RequestTrustTokensView.ts +40 -40
- package/front_end/panels/network/components/WebBundleInfoView.ts +9 -9
- package/front_end/panels/performance_monitor/PerformanceMonitor.ts +92 -37
- package/front_end/panels/performance_monitor/performanceMonitor.css +32 -0
- package/front_end/panels/protocol_monitor/ProtocolMonitor.ts +2 -2
- package/front_end/panels/settings/components/SyncSection.ts +14 -14
- package/front_end/panels/settings/emulation/components/UserAgentClientHintsForm.ts +96 -96
- package/front_end/panels/sources/BreakpointEditDialog.ts +4 -3
- package/front_end/panels/timeline/TimelineFlameChartView.ts +1 -1
- package/front_end/panels/timeline/TimelineTreeView.ts +1 -1
- package/front_end/panels/timeline/components/WebVitalsLane.ts +77 -76
- package/front_end/panels/timeline/components/WebVitalsTimeline.ts +133 -133
- package/front_end/panels/timeline/components/WebVitalsTooltip.ts +9 -9
- package/front_end/panels/webauthn/WebauthnPane.ts +203 -205
- package/front_end/third_party/diff/DiffWrapper.ts +7 -0
- package/front_end/ui/components/adorners/Adorner.ts +2 -2
- package/front_end/ui/components/buttons/Button.ts +9 -9
- package/front_end/ui/components/data_grid/DataGrid.ts +64 -64
- package/front_end/ui/components/data_grid/DataGridController.ts +22 -22
- package/front_end/ui/components/data_grid/DataGridUtils.ts +3 -0
- package/front_end/ui/components/diff_view/DiffView.ts +6 -6
- package/front_end/ui/components/expandable_list/ExpandableList.ts +5 -5
- package/front_end/ui/components/icon_button/Icon.ts +4 -4
- package/front_end/ui/components/icon_button/IconButton.ts +4 -4
- package/front_end/ui/components/issue_counter/IssueCounter.ts +3 -3
- package/front_end/ui/components/issue_counter/IssueLinkIcon.ts +11 -11
- package/front_end/ui/components/linear_memory_inspector/LinearMemoryInspector.ts +50 -50
- package/front_end/ui/components/linear_memory_inspector/LinearMemoryInspectorController.ts +6 -6
- package/front_end/ui/components/linear_memory_inspector/LinearMemoryInspectorPane.ts +4 -4
- package/front_end/ui/components/linear_memory_inspector/LinearMemoryNavigator.ts +12 -12
- package/front_end/ui/components/linear_memory_inspector/LinearMemoryValueInterpreter.ts +11 -11
- package/front_end/ui/components/linear_memory_inspector/LinearMemoryViewer.ts +40 -39
- package/front_end/ui/components/linear_memory_inspector/ValueInterpreterDisplay.ts +18 -18
- package/front_end/ui/components/linear_memory_inspector/ValueInterpreterSettings.ts +6 -6
- package/front_end/ui/components/linkifier/LinkifierImpl.ts +4 -4
- package/front_end/ui/components/markdown_view/MarkdownImage.ts +5 -5
- package/front_end/ui/components/markdown_view/MarkdownLink.ts +2 -2
- package/front_end/ui/components/markdown_view/MarkdownView.ts +4 -4
- package/front_end/ui/components/panel_feedback/FeedbackButton.ts +2 -2
- package/front_end/ui/components/panel_feedback/PanelFeedback.ts +2 -2
- package/front_end/ui/components/panel_feedback/PreviewToggle.ts +4 -4
- package/front_end/ui/components/render_coordinator/RenderCoordinator.ts +22 -22
- package/front_end/ui/components/report_view/ReportView.ts +16 -16
- package/front_end/ui/components/request_link_icon/RequestLinkIcon.ts +14 -14
- package/front_end/ui/components/settings/SettingCheckbox.ts +5 -5
- package/front_end/ui/components/survey_link/SurveyLink.ts +8 -8
- package/front_end/ui/components/text_editor/TextEditor.ts +9 -9
- package/front_end/ui/components/text_prompt/TextPrompt.ts +18 -18
- package/front_end/ui/components/tree_outline/TreeOutline.ts +69 -70
- package/front_end/ui/legacy/SearchableView.ts +13 -4
- package/front_end/ui/legacy/components/source_frame/JSONView.ts +1 -1
- package/front_end/ui/legacy/components/source_frame/SourceFrame.ts +13 -12
- package/front_end/ui/legacy/components/source_frame/XMLView.ts +2 -2
- package/front_end/ui/legacy/themeColors.css +2 -0
- package/front_end/ui/legacy/theme_support/theme_support_impl.ts +34 -7
- package/package.json +1 -1
- package/scripts/eslint_rules/lib/use_private_class_members.js +41 -0
- package/scripts/eslint_rules/tests/use_private_class_members_test.js +62 -0
- package/scripts/migration/class-fields/migrate.js +2 -3
- package/scripts/migration/class-fields/migrate.sh +1 -3
- package/scripts/migration/class-fields/package.json +1 -1
- package/config/gni/all_devtools_files.gni +0 -255
- package/scripts/build/devtools_file_hashes.py +0 -82
- package/scripts/devtools_run/devtools_run_cli +0 -49
- package/scripts/devtools_run/package.json +0 -13
- package/scripts/unzip.py +0 -20
- package/scripts/visualize_deps/jquery_svg.html +0 -57
- package/scripts/visualize_deps/run_visualize.js +0 -119
|
@@ -59,13 +59,13 @@ export function getClassNameFromKind(kind: IssuesManager.Issue.IssueKind): strin
|
|
|
59
59
|
}
|
|
60
60
|
|
|
61
61
|
export class IssueKindView extends UI.TreeOutline.TreeElement {
|
|
62
|
-
|
|
63
|
-
|
|
62
|
+
#kind: IssuesManager.Issue.IssueKind;
|
|
63
|
+
#issueCount: HTMLElement;
|
|
64
64
|
|
|
65
65
|
constructor(kind: IssuesManager.Issue.IssueKind) {
|
|
66
66
|
super(undefined, true);
|
|
67
|
-
this
|
|
68
|
-
this
|
|
67
|
+
this.#kind = kind;
|
|
68
|
+
this.#issueCount = document.createElement('span');
|
|
69
69
|
|
|
70
70
|
this.toggleOnClick = true;
|
|
71
71
|
this.listItemElement.classList.add('issue-kind');
|
|
@@ -74,11 +74,11 @@ export class IssueKindView extends UI.TreeOutline.TreeElement {
|
|
|
74
74
|
}
|
|
75
75
|
|
|
76
76
|
getKind(): IssuesManager.Issue.IssueKind {
|
|
77
|
-
return this
|
|
77
|
+
return this.#kind;
|
|
78
78
|
}
|
|
79
79
|
|
|
80
80
|
getHideAllCurrentKindString(): Common.UIString.LocalizedString {
|
|
81
|
-
switch (this
|
|
81
|
+
switch (this.#kind) {
|
|
82
82
|
case IssuesManager.Issue.IssueKind.PageError:
|
|
83
83
|
return i18nString(UIStrings.hideAllCurrentPageErrors);
|
|
84
84
|
case IssuesManager.Issue.IssueKind.Improvement:
|
|
@@ -88,25 +88,25 @@ export class IssueKindView extends UI.TreeOutline.TreeElement {
|
|
|
88
88
|
}
|
|
89
89
|
}
|
|
90
90
|
|
|
91
|
-
|
|
91
|
+
#appendHeader(): void {
|
|
92
92
|
const header = document.createElement('div');
|
|
93
93
|
header.classList.add('header');
|
|
94
94
|
|
|
95
95
|
const issueKindIcon = new IconButton.Icon.Icon();
|
|
96
|
-
issueKindIcon.data = IssueCounter.IssueCounter.getIssueKindIconData(this
|
|
96
|
+
issueKindIcon.data = IssueCounter.IssueCounter.getIssueKindIconData(this.#kind);
|
|
97
97
|
issueKindIcon.classList.add('leading-issue-icon');
|
|
98
98
|
|
|
99
99
|
const countAdorner = new Adorners.Adorner.Adorner();
|
|
100
100
|
countAdorner.data = {
|
|
101
101
|
name: 'countWrapper',
|
|
102
|
-
content: this
|
|
102
|
+
content: this.#issueCount,
|
|
103
103
|
};
|
|
104
104
|
countAdorner.classList.add('aggregated-issues-count');
|
|
105
|
-
this
|
|
105
|
+
this.#issueCount.textContent = '0';
|
|
106
106
|
|
|
107
107
|
const title = document.createElement('div');
|
|
108
108
|
title.classList.add('title');
|
|
109
|
-
title.textContent = IssuesManager.Issue.getIssueKindName(this
|
|
109
|
+
title.textContent = IssuesManager.Issue.getIssueKindName(this.#kind);
|
|
110
110
|
|
|
111
111
|
const hideAvailableIssuesBtn = new Components.HideIssuesMenu.HideIssuesMenu();
|
|
112
112
|
hideAvailableIssuesBtn.classList.add('hide-available-issues');
|
|
@@ -116,7 +116,7 @@ export class IssueKindView extends UI.TreeOutline.TreeElement {
|
|
|
116
116
|
const setting = IssuesManager.IssuesManager.getHideIssueByCodeSetting();
|
|
117
117
|
const values = setting.get();
|
|
118
118
|
for (const issue of IssuesManager.IssuesManager.IssuesManager.instance().issues()) {
|
|
119
|
-
if (issue.getKind() === this
|
|
119
|
+
if (issue.getKind() === this.#kind) {
|
|
120
120
|
values[issue.code()] = IssuesManager.IssuesManager.IssueStatus.Hidden;
|
|
121
121
|
}
|
|
122
122
|
}
|
|
@@ -133,11 +133,11 @@ export class IssueKindView extends UI.TreeOutline.TreeElement {
|
|
|
133
133
|
}
|
|
134
134
|
|
|
135
135
|
onattach(): void {
|
|
136
|
-
this
|
|
136
|
+
this.#appendHeader();
|
|
137
137
|
this.expand();
|
|
138
138
|
}
|
|
139
139
|
|
|
140
140
|
update(count: number): void {
|
|
141
|
-
this
|
|
141
|
+
this.#issueCount.textContent = `${count}`;
|
|
142
142
|
}
|
|
143
143
|
}
|
|
@@ -88,7 +88,7 @@ const str_ = i18n.i18n.registerUIStrings('panels/issues/IssueView.ts', UIStrings
|
|
|
88
88
|
const i18nString = i18n.i18n.getLocalizedString.bind(undefined, str_);
|
|
89
89
|
|
|
90
90
|
class AffectedRequestsView extends AffectedResourcesView {
|
|
91
|
-
|
|
91
|
+
#appendAffectedRequests(affectedRequests: Iterable<Protocol.Audits.AffectedRequest>): void {
|
|
92
92
|
let count = 0;
|
|
93
93
|
for (const affectedRequest of affectedRequests) {
|
|
94
94
|
const element = document.createElement('tr');
|
|
@@ -125,7 +125,7 @@ class AffectedRequestsView extends AffectedResourcesView {
|
|
|
125
125
|
this.updateAffectedResourceCount(0);
|
|
126
126
|
return;
|
|
127
127
|
}
|
|
128
|
-
this
|
|
128
|
+
this.#appendAffectedRequests(this.issue.requests());
|
|
129
129
|
}
|
|
130
130
|
}
|
|
131
131
|
|
|
@@ -146,8 +146,8 @@ const issueTypeToNetworkHeaderMap =
|
|
|
146
146
|
]);
|
|
147
147
|
|
|
148
148
|
class AffectedMixedContentView extends AffectedResourcesView {
|
|
149
|
-
|
|
150
|
-
|
|
149
|
+
#appendAffectedMixedContentDetails(mixedContentIssues: Iterable<IssuesManager.MixedContentIssue.MixedContentIssue>):
|
|
150
|
+
void {
|
|
151
151
|
const header = document.createElement('tr');
|
|
152
152
|
this.appendColumnTitle(header, i18nString(UIStrings.name));
|
|
153
153
|
this.appendColumnTitle(header, i18nString(UIStrings.restrictionStatus));
|
|
@@ -207,60 +207,60 @@ class AffectedMixedContentView extends AffectedResourcesView {
|
|
|
207
207
|
|
|
208
208
|
update(): void {
|
|
209
209
|
this.clear();
|
|
210
|
-
this
|
|
210
|
+
this.#appendAffectedMixedContentDetails(this.issue.getMixedContentIssues());
|
|
211
211
|
}
|
|
212
212
|
}
|
|
213
213
|
|
|
214
214
|
export class IssueView extends UI.TreeOutline.TreeElement {
|
|
215
|
-
|
|
216
|
-
|
|
215
|
+
#issue: AggregatedIssue;
|
|
216
|
+
#description: IssuesManager.MarkdownIssueDescription.IssueDescription;
|
|
217
217
|
toggleOnClick: boolean;
|
|
218
218
|
affectedResources: UI.TreeOutline.TreeElement;
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
219
|
+
readonly #affectedResourceViews: AffectedResourcesView[];
|
|
220
|
+
#aggregatedIssuesCount: HTMLElement|null;
|
|
221
|
+
#issueKindIcon: IconButton.Icon.Icon|null = null;
|
|
222
|
+
#hasBeenExpandedBefore: boolean;
|
|
223
|
+
#throttle: Common.Throttler.Throttler;
|
|
224
|
+
#needsUpdateOnExpand = true;
|
|
225
|
+
#hiddenIssuesMenu?: Components.HideIssuesMenu.HideIssuesMenu;
|
|
226
|
+
#contentCreated: boolean = false;
|
|
227
227
|
|
|
228
228
|
constructor(issue: AggregatedIssue, description: IssuesManager.MarkdownIssueDescription.IssueDescription) {
|
|
229
229
|
super();
|
|
230
|
-
this
|
|
231
|
-
this
|
|
232
|
-
this
|
|
230
|
+
this.#issue = issue;
|
|
231
|
+
this.#description = description;
|
|
232
|
+
this.#throttle = new Common.Throttler.Throttler(250);
|
|
233
233
|
|
|
234
234
|
this.toggleOnClick = true;
|
|
235
235
|
this.listItemElement.classList.add('issue');
|
|
236
236
|
this.childrenListElement.classList.add('body');
|
|
237
|
-
this.childrenListElement.classList.add(IssueView.getBodyCSSClass(this
|
|
238
|
-
|
|
239
|
-
this.affectedResources = this
|
|
240
|
-
this
|
|
241
|
-
new AffectedCookiesView(this, this
|
|
242
|
-
new AffectedElementsView(this, this
|
|
243
|
-
new AffectedRequestsView(this, this
|
|
244
|
-
new AffectedMixedContentView(this, this
|
|
245
|
-
new AffectedSourcesView(this, this
|
|
246
|
-
new AffectedHeavyAdView(this, this
|
|
247
|
-
new AffectedDirectivesView(this, this
|
|
248
|
-
new AffectedBlockedByResponseView(this, this
|
|
249
|
-
new AffectedSharedArrayBufferIssueDetailsView(this, this
|
|
250
|
-
new AffectedElementsWithLowContrastView(this, this
|
|
251
|
-
new AffectedTrustedWebActivityIssueDetailsView(this, this
|
|
252
|
-
new CorsIssueDetailsView(this, this
|
|
253
|
-
new GenericIssueDetailsView(this, this
|
|
254
|
-
new AffectedDocumentsInQuirksModeView(this, this
|
|
255
|
-
new AttributionReportingIssueDetailsView(this, this
|
|
256
|
-
new WasmCrossOriginModuleSharingAffectedResourcesView(this, this
|
|
257
|
-
new AffectedRawCookieLinesView(this, this
|
|
237
|
+
this.childrenListElement.classList.add(IssueView.getBodyCSSClass(this.#issue.getKind()));
|
|
238
|
+
|
|
239
|
+
this.affectedResources = this.#createAffectedResources();
|
|
240
|
+
this.#affectedResourceViews = [
|
|
241
|
+
new AffectedCookiesView(this, this.#issue),
|
|
242
|
+
new AffectedElementsView(this, this.#issue),
|
|
243
|
+
new AffectedRequestsView(this, this.#issue),
|
|
244
|
+
new AffectedMixedContentView(this, this.#issue),
|
|
245
|
+
new AffectedSourcesView(this, this.#issue),
|
|
246
|
+
new AffectedHeavyAdView(this, this.#issue),
|
|
247
|
+
new AffectedDirectivesView(this, this.#issue),
|
|
248
|
+
new AffectedBlockedByResponseView(this, this.#issue),
|
|
249
|
+
new AffectedSharedArrayBufferIssueDetailsView(this, this.#issue),
|
|
250
|
+
new AffectedElementsWithLowContrastView(this, this.#issue),
|
|
251
|
+
new AffectedTrustedWebActivityIssueDetailsView(this, this.#issue),
|
|
252
|
+
new CorsIssueDetailsView(this, this.#issue),
|
|
253
|
+
new GenericIssueDetailsView(this, this.#issue),
|
|
254
|
+
new AffectedDocumentsInQuirksModeView(this, this.#issue),
|
|
255
|
+
new AttributionReportingIssueDetailsView(this, this.#issue),
|
|
256
|
+
new WasmCrossOriginModuleSharingAffectedResourcesView(this, this.#issue),
|
|
257
|
+
new AffectedRawCookieLinesView(this, this.#issue),
|
|
258
258
|
];
|
|
259
259
|
if (Root.Runtime.experiments.isEnabled('hideIssuesFeature')) {
|
|
260
|
-
this
|
|
260
|
+
this.#hiddenIssuesMenu = new Components.HideIssuesMenu.HideIssuesMenu();
|
|
261
261
|
}
|
|
262
|
-
this
|
|
263
|
-
this
|
|
262
|
+
this.#aggregatedIssuesCount = null;
|
|
263
|
+
this.#hasBeenExpandedBefore = false;
|
|
264
264
|
}
|
|
265
265
|
|
|
266
266
|
/**
|
|
@@ -269,11 +269,11 @@ export class IssueView extends UI.TreeOutline.TreeElement {
|
|
|
269
269
|
* title and issue description will not be updated.
|
|
270
270
|
*/
|
|
271
271
|
setIssue(issue: AggregatedIssue): void {
|
|
272
|
-
if (this
|
|
273
|
-
this
|
|
272
|
+
if (this.#issue !== issue) {
|
|
273
|
+
this.#needsUpdateOnExpand = true;
|
|
274
274
|
}
|
|
275
|
-
this
|
|
276
|
-
this
|
|
275
|
+
this.#issue = issue;
|
|
276
|
+
this.#affectedResourceViews.forEach(view => view.setIssue(issue));
|
|
277
277
|
}
|
|
278
278
|
|
|
279
279
|
private static getBodyCSSClass(issueKind: IssuesManager.Issue.IssueKind): string {
|
|
@@ -288,11 +288,11 @@ export class IssueView extends UI.TreeOutline.TreeElement {
|
|
|
288
288
|
}
|
|
289
289
|
|
|
290
290
|
getIssueTitle(): string {
|
|
291
|
-
return this
|
|
291
|
+
return this.#description.title;
|
|
292
292
|
}
|
|
293
293
|
|
|
294
294
|
onattach(): void {
|
|
295
|
-
if (!this
|
|
295
|
+
if (!this.#contentCreated) {
|
|
296
296
|
this.createContent();
|
|
297
297
|
return;
|
|
298
298
|
}
|
|
@@ -300,96 +300,96 @@ export class IssueView extends UI.TreeOutline.TreeElement {
|
|
|
300
300
|
}
|
|
301
301
|
|
|
302
302
|
createContent(): void {
|
|
303
|
-
this
|
|
304
|
-
this
|
|
303
|
+
this.#appendHeader();
|
|
304
|
+
this.#createBody();
|
|
305
305
|
this.appendChild(this.affectedResources);
|
|
306
|
-
for (const view of this
|
|
306
|
+
for (const view of this.#affectedResourceViews) {
|
|
307
307
|
this.appendAffectedResource(view);
|
|
308
308
|
view.update();
|
|
309
309
|
}
|
|
310
310
|
|
|
311
|
-
this
|
|
311
|
+
this.#createReadMoreLinks();
|
|
312
312
|
this.updateAffectedResourceVisibility();
|
|
313
|
-
this
|
|
313
|
+
this.#contentCreated = true;
|
|
314
314
|
}
|
|
315
315
|
|
|
316
316
|
appendAffectedResource(resource: UI.TreeOutline.TreeElement): void {
|
|
317
317
|
this.affectedResources.appendChild(resource);
|
|
318
318
|
}
|
|
319
319
|
|
|
320
|
-
|
|
320
|
+
#appendHeader(): void {
|
|
321
321
|
const header = document.createElement('div');
|
|
322
322
|
header.classList.add('header');
|
|
323
|
-
this
|
|
324
|
-
this
|
|
325
|
-
this
|
|
323
|
+
this.#issueKindIcon = new IconButton.Icon.Icon();
|
|
324
|
+
this.#issueKindIcon.classList.add('leading-issue-icon');
|
|
325
|
+
this.#aggregatedIssuesCount = document.createElement('span');
|
|
326
326
|
const countAdorner = new Adorners.Adorner.Adorner();
|
|
327
327
|
countAdorner.data = {
|
|
328
328
|
name: 'countWrapper',
|
|
329
|
-
content: this
|
|
329
|
+
content: this.#aggregatedIssuesCount,
|
|
330
330
|
};
|
|
331
331
|
countAdorner.classList.add('aggregated-issues-count');
|
|
332
|
-
header.appendChild(this
|
|
332
|
+
header.appendChild(this.#issueKindIcon);
|
|
333
333
|
header.appendChild(countAdorner);
|
|
334
334
|
|
|
335
335
|
const title = document.createElement('div');
|
|
336
336
|
title.classList.add('title');
|
|
337
|
-
title.textContent = this
|
|
337
|
+
title.textContent = this.#description.title;
|
|
338
338
|
header.appendChild(title);
|
|
339
|
-
if (this
|
|
340
|
-
header.appendChild(this
|
|
339
|
+
if (this.#hiddenIssuesMenu) {
|
|
340
|
+
header.appendChild(this.#hiddenIssuesMenu);
|
|
341
341
|
}
|
|
342
|
-
this
|
|
342
|
+
this.#updateFromIssue();
|
|
343
343
|
this.listItemElement.appendChild(header);
|
|
344
344
|
}
|
|
345
345
|
|
|
346
346
|
onexpand(): void {
|
|
347
|
-
Host.userMetrics.issuesPanelIssueExpanded(this
|
|
347
|
+
Host.userMetrics.issuesPanelIssueExpanded(this.#issue.getCategory());
|
|
348
348
|
|
|
349
|
-
if (this
|
|
350
|
-
this
|
|
349
|
+
if (this.#needsUpdateOnExpand) {
|
|
350
|
+
this.#doUpdate();
|
|
351
351
|
}
|
|
352
352
|
|
|
353
|
-
if (!this
|
|
354
|
-
this
|
|
355
|
-
for (const view of this
|
|
353
|
+
if (!this.#hasBeenExpandedBefore) {
|
|
354
|
+
this.#hasBeenExpandedBefore = true;
|
|
355
|
+
for (const view of this.#affectedResourceViews) {
|
|
356
356
|
view.expandIfOneResource();
|
|
357
357
|
}
|
|
358
358
|
}
|
|
359
359
|
}
|
|
360
360
|
|
|
361
|
-
|
|
362
|
-
if (this
|
|
363
|
-
const kind = this
|
|
364
|
-
this
|
|
365
|
-
this
|
|
361
|
+
#updateFromIssue(): void {
|
|
362
|
+
if (this.#issueKindIcon) {
|
|
363
|
+
const kind = this.#issue.getKind();
|
|
364
|
+
this.#issueKindIcon.data = IssueCounter.IssueCounter.getIssueKindIconData(kind);
|
|
365
|
+
this.#issueKindIcon.title = IssuesManager.Issue.getIssueKindDescription(kind);
|
|
366
366
|
}
|
|
367
|
-
if (this
|
|
368
|
-
this
|
|
367
|
+
if (this.#aggregatedIssuesCount) {
|
|
368
|
+
this.#aggregatedIssuesCount.textContent = `${this.#issue.getAggregatedIssuesCount()}`;
|
|
369
369
|
}
|
|
370
|
-
this.listItemElement.classList.toggle('hidden-issue', this
|
|
371
|
-
if (this
|
|
370
|
+
this.listItemElement.classList.toggle('hidden-issue', this.#issue.isHidden());
|
|
371
|
+
if (this.#hiddenIssuesMenu) {
|
|
372
372
|
const data: HiddenIssuesMenuData = {
|
|
373
|
-
menuItemLabel: this
|
|
374
|
-
|
|
373
|
+
menuItemLabel: this.#issue.isHidden() ? i18nString(UIStrings.unhideIssuesLikeThis) :
|
|
374
|
+
i18nString(UIStrings.hideIssuesLikeThis),
|
|
375
375
|
menuItemAction: () => {
|
|
376
376
|
const setting = IssuesManager.IssuesManager.getHideIssueByCodeSetting();
|
|
377
377
|
const values = setting.get();
|
|
378
|
-
values[this
|
|
379
|
-
|
|
378
|
+
values[this.#issue.code()] = this.#issue.isHidden() ? IssuesManager.IssuesManager.IssueStatus.Unhidden :
|
|
379
|
+
IssuesManager.IssuesManager.IssueStatus.Hidden;
|
|
380
380
|
setting.set(values);
|
|
381
381
|
},
|
|
382
382
|
};
|
|
383
|
-
this
|
|
383
|
+
this.#hiddenIssuesMenu.data = data;
|
|
384
384
|
}
|
|
385
385
|
}
|
|
386
386
|
|
|
387
387
|
updateAffectedResourceVisibility(): void {
|
|
388
|
-
const noResources = this
|
|
388
|
+
const noResources = this.#affectedResourceViews.every(view => view.isEmpty());
|
|
389
389
|
this.affectedResources.hidden = noResources;
|
|
390
390
|
}
|
|
391
391
|
|
|
392
|
-
|
|
392
|
+
#createAffectedResources(): UI.TreeOutline.TreeElement {
|
|
393
393
|
const wrapper = new UI.TreeOutline.TreeElement();
|
|
394
394
|
wrapper.setCollapsible(false);
|
|
395
395
|
wrapper.setExpandable(true);
|
|
@@ -401,18 +401,18 @@ export class IssueView extends UI.TreeOutline.TreeElement {
|
|
|
401
401
|
return wrapper;
|
|
402
402
|
}
|
|
403
403
|
|
|
404
|
-
|
|
404
|
+
#createBody(): void {
|
|
405
405
|
const messageElement = new UI.TreeOutline.TreeElement();
|
|
406
406
|
messageElement.setCollapsible(false);
|
|
407
407
|
messageElement.selectable = false;
|
|
408
408
|
const markdownComponent = new MarkdownView.MarkdownView.MarkdownView();
|
|
409
|
-
markdownComponent.data = {tokens: this
|
|
409
|
+
markdownComponent.data = {tokens: this.#description.markdown};
|
|
410
410
|
messageElement.listItemElement.appendChild(markdownComponent);
|
|
411
411
|
this.appendChild(messageElement);
|
|
412
412
|
}
|
|
413
413
|
|
|
414
|
-
|
|
415
|
-
if (this
|
|
414
|
+
#createReadMoreLinks(): void {
|
|
415
|
+
if (this.#description.links.length === 0) {
|
|
416
416
|
return;
|
|
417
417
|
}
|
|
418
418
|
|
|
@@ -421,7 +421,7 @@ export class IssueView extends UI.TreeOutline.TreeElement {
|
|
|
421
421
|
linkWrapper.listItemElement.classList.add('link-wrapper');
|
|
422
422
|
|
|
423
423
|
const linkList = linkWrapper.listItemElement.createChild('ul', 'link-list');
|
|
424
|
-
for (const description of this
|
|
424
|
+
for (const description of this.#description.links) {
|
|
425
425
|
const link = UI.Fragment.html`<x-link class="link devtools-link" tabindex="0" href=${description.link}>${
|
|
426
426
|
i18nString(UIStrings.learnMoreS, {PH1: description.linkTitle})}</x-link>` as UI.XLink.XLink;
|
|
427
427
|
const linkIcon = new IconButton.Icon.Icon();
|
|
@@ -429,7 +429,7 @@ export class IssueView extends UI.TreeOutline.TreeElement {
|
|
|
429
429
|
linkIcon.classList.add('link-icon');
|
|
430
430
|
link.prepend(linkIcon);
|
|
431
431
|
link.addEventListener('x-link-invoke', () => {
|
|
432
|
-
Host.userMetrics.issuesPanelResourceOpened(this
|
|
432
|
+
Host.userMetrics.issuesPanelResourceOpened(this.#issue.getCategory(), AffectedItem.LearnMore);
|
|
433
433
|
});
|
|
434
434
|
|
|
435
435
|
const linkListItem = linkList.createChild('li');
|
|
@@ -438,25 +438,25 @@ export class IssueView extends UI.TreeOutline.TreeElement {
|
|
|
438
438
|
this.appendChild(linkWrapper);
|
|
439
439
|
}
|
|
440
440
|
|
|
441
|
-
|
|
441
|
+
#doUpdate(): void {
|
|
442
442
|
if (this.expanded) {
|
|
443
|
-
this
|
|
443
|
+
this.#affectedResourceViews.forEach(view => view.update());
|
|
444
444
|
this.updateAffectedResourceVisibility();
|
|
445
445
|
}
|
|
446
|
-
this
|
|
447
|
-
this
|
|
446
|
+
this.#needsUpdateOnExpand = !this.expanded;
|
|
447
|
+
this.#updateFromIssue();
|
|
448
448
|
}
|
|
449
449
|
|
|
450
450
|
update(): void {
|
|
451
|
-
this
|
|
451
|
+
this.#throttle.schedule(async () => this.#doUpdate());
|
|
452
452
|
}
|
|
453
453
|
|
|
454
454
|
getIssueKind(): IssuesManager.Issue.IssueKind {
|
|
455
|
-
return this
|
|
455
|
+
return this.#issue.getKind();
|
|
456
456
|
}
|
|
457
457
|
|
|
458
458
|
isForHiddenIssue(): boolean {
|
|
459
|
-
return this
|
|
459
|
+
return this.#issue.isHidden();
|
|
460
460
|
}
|
|
461
461
|
|
|
462
462
|
toggle(expand?: boolean): void {
|