chrome-devtools-frontend 1.0.951864 → 1.0.952284
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/front_end/.eslintrc.js +6 -0
- package/front_end/entrypoints/formatter_worker/AcornTokenizer.ts +36 -36
- package/front_end/entrypoints/formatter_worker/CSSFormatter.ts +53 -53
- package/front_end/entrypoints/formatter_worker/ESTreeWalker.ts +11 -11
- package/front_end/entrypoints/formatter_worker/FormattedContentBuilder.ts +43 -43
- package/front_end/entrypoints/formatter_worker/HTMLFormatter.ts +106 -105
- package/front_end/entrypoints/formatter_worker/JavaScriptFormatter.ts +26 -26
- package/front_end/entrypoints/heap_snapshot_worker/AllocationProfile.ts +50 -55
- package/front_end/entrypoints/heap_snapshot_worker/HeapSnapshot.ts +200 -200
- package/front_end/entrypoints/heap_snapshot_worker/HeapSnapshotLoader.ts +84 -83
- package/front_end/entrypoints/heap_snapshot_worker/HeapSnapshotWorkerDispatcher.ts +15 -15
- package/front_end/entrypoints/inspector_main/InspectorMain.ts +21 -21
- package/front_end/entrypoints/main/ExecutionContextSelector.ts +30 -30
- package/front_end/entrypoints/main/MainImpl.ts +12 -12
- package/front_end/entrypoints/node_app/NodeConnectionsPanel.ts +33 -33
- package/front_end/entrypoints/node_app/NodeMain.ts +35 -35
- package/front_end/generated/InspectorBackendCommands.js +5 -1
- package/front_end/generated/protocol.d.ts +16 -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 +56 -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/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/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 +6 -12
- 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/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/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 +62 -62
- package/front_end/ui/components/data_grid/DataGridController.ts +22 -22
- 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/themeColors.css +2 -0
- package/front_end/ui/legacy/theme_support/theme_support_impl.ts +12 -0
- 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
|
@@ -62,27 +62,27 @@ export interface CreateRequestCellOptions {
|
|
|
62
62
|
* as well as machinery for resolving request and frame ids to SDK objects.
|
|
63
63
|
*/
|
|
64
64
|
export abstract class AffectedResourcesView extends UI.TreeOutline.TreeElement {
|
|
65
|
-
|
|
65
|
+
readonly #parentView: IssueView;
|
|
66
66
|
protected issue: AggregatedIssue;
|
|
67
67
|
protected affectedResourcesCountElement: HTMLElement;
|
|
68
68
|
protected affectedResources: HTMLElement;
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
69
|
+
#affectedResourcesCount: number;
|
|
70
|
+
#frameListeners: Common.EventTarget.EventDescriptor[];
|
|
71
|
+
#unresolvedFrameIds: Set<string>;
|
|
72
72
|
protected requestResolver: Logs.RequestResolver.RequestResolver;
|
|
73
73
|
|
|
74
74
|
constructor(parent: IssueView, issue: AggregatedIssue) {
|
|
75
75
|
super();
|
|
76
|
-
this
|
|
76
|
+
this.#parentView = parent;
|
|
77
77
|
this.issue = issue;
|
|
78
78
|
this.toggleOnClick = true;
|
|
79
79
|
this.affectedResourcesCountElement = this.createAffectedResourcesCounter();
|
|
80
80
|
|
|
81
81
|
this.affectedResources = this.createAffectedResources();
|
|
82
|
-
this
|
|
82
|
+
this.#affectedResourcesCount = 0;
|
|
83
83
|
this.requestResolver = new Logs.RequestResolver.RequestResolver();
|
|
84
|
-
this
|
|
85
|
-
this
|
|
84
|
+
this.#frameListeners = [];
|
|
85
|
+
this.#unresolvedFrameIds = new Set();
|
|
86
86
|
}
|
|
87
87
|
|
|
88
88
|
/**
|
|
@@ -113,14 +113,14 @@ export abstract class AffectedResourcesView extends UI.TreeOutline.TreeElement {
|
|
|
113
113
|
protected abstract getResourceNameWithCount(count: number): string;
|
|
114
114
|
|
|
115
115
|
protected updateAffectedResourceCount(count: number): void {
|
|
116
|
-
this
|
|
116
|
+
this.#affectedResourcesCount = count;
|
|
117
117
|
this.affectedResourcesCountElement.textContent = this.getResourceNameWithCount(count);
|
|
118
|
-
this.hidden = this
|
|
119
|
-
this
|
|
118
|
+
this.hidden = this.#affectedResourcesCount === 0;
|
|
119
|
+
this.#parentView.updateAffectedResourceVisibility();
|
|
120
120
|
}
|
|
121
121
|
|
|
122
122
|
isEmpty(): boolean {
|
|
123
|
-
return this
|
|
123
|
+
return this.#affectedResourcesCount === 0;
|
|
124
124
|
}
|
|
125
125
|
|
|
126
126
|
clear(): void {
|
|
@@ -129,7 +129,7 @@ export abstract class AffectedResourcesView extends UI.TreeOutline.TreeElement {
|
|
|
129
129
|
}
|
|
130
130
|
|
|
131
131
|
expandIfOneResource(): void {
|
|
132
|
-
if (this
|
|
132
|
+
if (this.#affectedResourcesCount === 1) {
|
|
133
133
|
this.expand();
|
|
134
134
|
}
|
|
135
135
|
}
|
|
@@ -139,32 +139,31 @@ export abstract class AffectedResourcesView extends UI.TreeOutline.TreeElement {
|
|
|
139
139
|
* a listener is installed that takes care of updating the view if the frame is added. This is useful if the issue is
|
|
140
140
|
* added before the frame gets reported.
|
|
141
141
|
*/
|
|
142
|
-
|
|
142
|
+
#resolveFrameId(frameId: Protocol.Page.FrameId): SDK.ResourceTreeModel.ResourceTreeFrame|null {
|
|
143
143
|
const frame = SDK.FrameManager.FrameManager.instance().getFrame(frameId);
|
|
144
144
|
if (!frame || !frame.url) {
|
|
145
|
-
this
|
|
146
|
-
if (!this
|
|
145
|
+
this.#unresolvedFrameIds.add(frameId);
|
|
146
|
+
if (!this.#frameListeners.length) {
|
|
147
147
|
const addListener = SDK.FrameManager.FrameManager.instance().addEventListener(
|
|
148
|
-
SDK.FrameManager.Events.FrameAddedToTarget, this
|
|
148
|
+
SDK.FrameManager.Events.FrameAddedToTarget, this.#onFrameChanged, this);
|
|
149
149
|
const navigateListener = SDK.FrameManager.FrameManager.instance().addEventListener(
|
|
150
|
-
SDK.FrameManager.Events.FrameNavigated, this
|
|
151
|
-
this
|
|
150
|
+
SDK.FrameManager.Events.FrameNavigated, this.#onFrameChanged, this);
|
|
151
|
+
this.#frameListeners = [addListener, navigateListener];
|
|
152
152
|
}
|
|
153
153
|
}
|
|
154
154
|
return frame;
|
|
155
155
|
}
|
|
156
156
|
|
|
157
|
-
|
|
158
|
-
void {
|
|
157
|
+
#onFrameChanged(event: Common.EventTarget.EventTargetEvent<{frame: SDK.ResourceTreeModel.ResourceTreeFrame}>): void {
|
|
159
158
|
const frame = event.data.frame;
|
|
160
159
|
if (!frame.url) {
|
|
161
160
|
return;
|
|
162
161
|
}
|
|
163
|
-
const frameWasUnresolved = this
|
|
164
|
-
if (this
|
|
162
|
+
const frameWasUnresolved = this.#unresolvedFrameIds.delete(frame.id);
|
|
163
|
+
if (this.#unresolvedFrameIds.size === 0 && this.#frameListeners.length) {
|
|
165
164
|
// Stop listening once all requests are resolved.
|
|
166
|
-
Common.EventTarget.removeEventListeners(this
|
|
167
|
-
this
|
|
165
|
+
Common.EventTarget.removeEventListeners(this.#frameListeners);
|
|
166
|
+
this.#frameListeners = [];
|
|
168
167
|
}
|
|
169
168
|
if (frameWasUnresolved) {
|
|
170
169
|
this.update();
|
|
@@ -173,7 +172,7 @@ export abstract class AffectedResourcesView extends UI.TreeOutline.TreeElement {
|
|
|
173
172
|
|
|
174
173
|
protected createFrameCell(frameId: Protocol.Page.FrameId, issueCategory: IssuesManager.Issue.IssueCategory):
|
|
175
174
|
HTMLElement {
|
|
176
|
-
const frame = this
|
|
175
|
+
const frame = this.#resolveFrameId(frameId);
|
|
177
176
|
const url = frame && (frame.unreachableUrl() || frame.url) || i18nString(UIStrings.unknown);
|
|
178
177
|
|
|
179
178
|
const frameCell = document.createElement('td');
|
|
@@ -58,7 +58,7 @@ export class AffectedSharedArrayBufferIssueDetailsView extends AffectedResources
|
|
|
58
58
|
return i18nString(UIStrings.nViolations, {n: count});
|
|
59
59
|
}
|
|
60
60
|
|
|
61
|
-
|
|
61
|
+
#appendStatus(element: HTMLElement, isWarning: boolean): void {
|
|
62
62
|
const status = document.createElement('td');
|
|
63
63
|
if (isWarning) {
|
|
64
64
|
status.classList.add('affected-resource-report-only-status');
|
|
@@ -70,7 +70,7 @@ export class AffectedSharedArrayBufferIssueDetailsView extends AffectedResources
|
|
|
70
70
|
element.appendChild(status);
|
|
71
71
|
}
|
|
72
72
|
|
|
73
|
-
|
|
73
|
+
#appendType(element: HTMLElement, type: Protocol.Audits.SharedArrayBufferIssueType): void {
|
|
74
74
|
const status = document.createElement('td');
|
|
75
75
|
switch (type) {
|
|
76
76
|
case Protocol.Audits.SharedArrayBufferIssueType.CreationIssue:
|
|
@@ -85,7 +85,7 @@ export class AffectedSharedArrayBufferIssueDetailsView extends AffectedResources
|
|
|
85
85
|
element.appendChild(status);
|
|
86
86
|
}
|
|
87
87
|
|
|
88
|
-
|
|
88
|
+
#appendDetails(sabIssues: Iterable<IssuesManager.SharedArrayBufferIssue.SharedArrayBufferIssue>): void {
|
|
89
89
|
const header = document.createElement('tr');
|
|
90
90
|
this.appendColumnTitle(header, i18nString(UIStrings.sourceLocation));
|
|
91
91
|
this.appendColumnTitle(header, i18nString(UIStrings.trigger));
|
|
@@ -95,26 +95,26 @@ export class AffectedSharedArrayBufferIssueDetailsView extends AffectedResources
|
|
|
95
95
|
let count = 0;
|
|
96
96
|
for (const sabIssue of sabIssues) {
|
|
97
97
|
count++;
|
|
98
|
-
this
|
|
98
|
+
this.#appendDetail(sabIssue);
|
|
99
99
|
}
|
|
100
100
|
this.updateAffectedResourceCount(count);
|
|
101
101
|
}
|
|
102
102
|
|
|
103
|
-
|
|
103
|
+
#appendDetail(sabIssue: IssuesManager.SharedArrayBufferIssue.SharedArrayBufferIssue): void {
|
|
104
104
|
const element = document.createElement('tr');
|
|
105
105
|
element.classList.add('affected-resource-directive');
|
|
106
106
|
|
|
107
107
|
const sabIssueDetails = sabIssue.details();
|
|
108
108
|
const location = IssuesManager.Issue.toZeroBasedLocation(sabIssueDetails.sourceCodeLocation);
|
|
109
109
|
this.appendSourceLocation(element, location, sabIssue.model()?.getTargetIfNotDisposed());
|
|
110
|
-
this
|
|
111
|
-
this
|
|
110
|
+
this.#appendType(element, sabIssueDetails.type);
|
|
111
|
+
this.#appendStatus(element, sabIssueDetails.isWarning);
|
|
112
112
|
|
|
113
113
|
this.affectedResources.appendChild(element);
|
|
114
114
|
}
|
|
115
115
|
|
|
116
116
|
update(): void {
|
|
117
117
|
this.clear();
|
|
118
|
-
this
|
|
118
|
+
this.#appendDetails(this.issue.getSharedArrayBufferIssues());
|
|
119
119
|
}
|
|
120
120
|
}
|
|
@@ -19,10 +19,10 @@ const str_ = i18n.i18n.registerUIStrings('panels/issues/AffectedSourcesView.ts',
|
|
|
19
19
|
const i18nString = i18n.i18n.getLocalizedString.bind(undefined, str_);
|
|
20
20
|
|
|
21
21
|
export class AffectedSourcesView extends AffectedResourcesView {
|
|
22
|
-
|
|
22
|
+
#appendAffectedSources(affectedSources: Iterable<Protocol.Audits.SourceCodeLocation>): void {
|
|
23
23
|
let count = 0;
|
|
24
24
|
for (const source of affectedSources) {
|
|
25
|
-
this
|
|
25
|
+
this.#appendAffectedSource(source);
|
|
26
26
|
count++;
|
|
27
27
|
}
|
|
28
28
|
this.updateAffectedResourceCount(count);
|
|
@@ -32,7 +32,7 @@ export class AffectedSourcesView extends AffectedResourcesView {
|
|
|
32
32
|
return i18nString(UIStrings.nSources, {n: count});
|
|
33
33
|
}
|
|
34
34
|
|
|
35
|
-
|
|
35
|
+
#appendAffectedSource({url, lineNumber, columnNumber}: Protocol.Audits.SourceCodeLocation): void {
|
|
36
36
|
const cellElement = document.createElement('td');
|
|
37
37
|
// TODO(chromium:1072331): Check feasibility of plumping through scriptId for `linkifyScriptLocation`
|
|
38
38
|
// to support source maps and formatted scripts.
|
|
@@ -52,6 +52,6 @@ export class AffectedSourcesView extends AffectedResourcesView {
|
|
|
52
52
|
|
|
53
53
|
update(): void {
|
|
54
54
|
this.clear();
|
|
55
|
-
this
|
|
55
|
+
this.#appendAffectedSources(this.issue.sources());
|
|
56
56
|
}
|
|
57
57
|
}
|
|
@@ -37,7 +37,7 @@ export class AffectedTrustedWebActivityIssueDetailsView extends AffectedResource
|
|
|
37
37
|
return i18nString(UIStrings.nResources, {n: count});
|
|
38
38
|
}
|
|
39
39
|
|
|
40
|
-
|
|
40
|
+
#appendDetail(twaIssue: IssuesManager.TrustedWebActivityIssue.TrustedWebActivityIssue): void {
|
|
41
41
|
const element = document.createElement('tr');
|
|
42
42
|
element.classList.add('affected-resource-row');
|
|
43
43
|
|
|
@@ -56,7 +56,7 @@ export class AffectedTrustedWebActivityIssueDetailsView extends AffectedResource
|
|
|
56
56
|
this.affectedResources.appendChild(element);
|
|
57
57
|
}
|
|
58
58
|
|
|
59
|
-
|
|
59
|
+
#appendDetails(twaIssues: Iterable<IssuesManager.TrustedWebActivityIssue.TrustedWebActivityIssue>): void {
|
|
60
60
|
const header = document.createElement('tr');
|
|
61
61
|
if (this.issue.code() === IssuesManager.TrustedWebActivityIssue.httpViolationCode) {
|
|
62
62
|
this.appendColumnTitle(header, i18nString(UIStrings.statusCode));
|
|
@@ -72,7 +72,7 @@ export class AffectedTrustedWebActivityIssueDetailsView extends AffectedResource
|
|
|
72
72
|
|
|
73
73
|
let count = 0;
|
|
74
74
|
for (const twaIssue of twaIssues) {
|
|
75
|
-
this
|
|
75
|
+
this.#appendDetail(twaIssue);
|
|
76
76
|
count++;
|
|
77
77
|
}
|
|
78
78
|
this.updateAffectedResourceCount(count);
|
|
@@ -80,6 +80,6 @@ export class AffectedTrustedWebActivityIssueDetailsView extends AffectedResource
|
|
|
80
80
|
|
|
81
81
|
update(): void {
|
|
82
82
|
this.clear();
|
|
83
|
-
this
|
|
83
|
+
this.#appendDetails(this.issue.getTrustedWebActivityIssues());
|
|
84
84
|
}
|
|
85
85
|
}
|
|
@@ -80,13 +80,13 @@ export class AttributionReportingIssueDetailsView extends AffectedResourcesView
|
|
|
80
80
|
this.clear();
|
|
81
81
|
const issues = this.issue.getAttributionReportingIssues();
|
|
82
82
|
if (issues.size > 0) {
|
|
83
|
-
this
|
|
83
|
+
this.#appendDetails(issues.values().next().value.code(), issues);
|
|
84
84
|
} else {
|
|
85
85
|
this.updateAffectedResourceCount(0);
|
|
86
86
|
}
|
|
87
87
|
}
|
|
88
88
|
|
|
89
|
-
|
|
89
|
+
#appendDetails(
|
|
90
90
|
issueCode: IssuesManager.AttributionReportingIssue.IssueCode,
|
|
91
91
|
issues: Iterable<IssuesManager.AttributionReportingIssue.AttributionReportingIssue>): void {
|
|
92
92
|
const header = document.createElement('tr');
|
|
@@ -156,12 +156,12 @@ export class AttributionReportingIssueDetailsView extends AffectedResourcesView
|
|
|
156
156
|
let count = 0;
|
|
157
157
|
for (const issue of issues) {
|
|
158
158
|
count++;
|
|
159
|
-
this
|
|
159
|
+
this.#appendDetail(issueCode, issue);
|
|
160
160
|
}
|
|
161
161
|
this.updateAffectedResourceCount(count);
|
|
162
162
|
}
|
|
163
163
|
|
|
164
|
-
|
|
164
|
+
async #appendDetail(
|
|
165
165
|
issueCode: IssuesManager.AttributionReportingIssue.IssueCode,
|
|
166
166
|
issue: IssuesManager.AttributionReportingIssue.AttributionReportingIssue): Promise<void> {
|
|
167
167
|
const element = document.createElement('tr');
|
|
@@ -171,12 +171,12 @@ export class AttributionReportingIssueDetailsView extends AffectedResourcesView
|
|
|
171
171
|
|
|
172
172
|
switch (issueCode) {
|
|
173
173
|
case IssuesManager.AttributionReportingIssue.IssueCode.AttributionUntrustworthyFrameOrigin:
|
|
174
|
-
this
|
|
175
|
-
this
|
|
174
|
+
this.#appendFrameOrEmptyCell(element, issue);
|
|
175
|
+
this.#appendRequestOrEmptyCell(element, details.request);
|
|
176
176
|
this.appendIssueDetailCell(element, details.invalidParameter || '');
|
|
177
177
|
break;
|
|
178
178
|
case IssuesManager.AttributionReportingIssue.IssueCode.AttributionSourceUntrustworthyOrigin:
|
|
179
|
-
await this
|
|
179
|
+
await this.#appendElementOrEmptyCell(element, issue);
|
|
180
180
|
this.appendIssueDetailCell(element, details.invalidParameter || '');
|
|
181
181
|
break;
|
|
182
182
|
case IssuesManager.AttributionReportingIssue.IssueCode.AttributionTriggerDataTooLarge:
|
|
@@ -186,31 +186,31 @@ export class AttributionReportingIssueDetailsView extends AffectedResourcesView
|
|
|
186
186
|
case IssuesManager.AttributionReportingIssue.IssueCode.InvalidEventSourceTriggerData:
|
|
187
187
|
case IssuesManager.AttributionReportingIssue.IssueCode.InvalidTriggerPriority:
|
|
188
188
|
case IssuesManager.AttributionReportingIssue.IssueCode.InvalidTriggerDedupKey:
|
|
189
|
-
this
|
|
189
|
+
this.#appendRequestOrEmptyCell(element, details.request);
|
|
190
190
|
this.appendIssueDetailCell(element, details.invalidParameter || '');
|
|
191
191
|
break;
|
|
192
192
|
case IssuesManager.AttributionReportingIssue.IssueCode.AttributionSourceUntrustworthyFrameOrigin:
|
|
193
193
|
case IssuesManager.AttributionReportingIssue.IssueCode.InvalidAttributionSourceEventId:
|
|
194
194
|
case IssuesManager.AttributionReportingIssue.IssueCode.InvalidAttributionSourceExpiry:
|
|
195
195
|
case IssuesManager.AttributionReportingIssue.IssueCode.InvalidAttributionSourcePriority:
|
|
196
|
-
this
|
|
197
|
-
await this
|
|
196
|
+
this.#appendFrameOrEmptyCell(element, issue);
|
|
197
|
+
await this.#appendElementOrEmptyCell(element, issue);
|
|
198
198
|
this.appendIssueDetailCell(element, details.invalidParameter || '');
|
|
199
199
|
break;
|
|
200
200
|
case IssuesManager.AttributionReportingIssue.IssueCode.MissingAttributionData:
|
|
201
|
-
this
|
|
201
|
+
this.#appendRequestOrEmptyCell(element, details.request);
|
|
202
202
|
break;
|
|
203
203
|
case IssuesManager.AttributionReportingIssue.IssueCode.PermissionPolicyDisabled:
|
|
204
|
-
this
|
|
205
|
-
await this
|
|
206
|
-
this
|
|
204
|
+
this.#appendFrameOrEmptyCell(element, issue);
|
|
205
|
+
await this.#appendElementOrEmptyCell(element, issue);
|
|
206
|
+
this.#appendRequestOrEmptyCell(element, details.request);
|
|
207
207
|
break;
|
|
208
208
|
}
|
|
209
209
|
|
|
210
210
|
this.affectedResources.appendChild(element);
|
|
211
211
|
}
|
|
212
212
|
|
|
213
|
-
|
|
213
|
+
#appendFrameOrEmptyCell(
|
|
214
214
|
parent: HTMLElement, issue: IssuesManager.AttributionReportingIssue.AttributionReportingIssue): void {
|
|
215
215
|
const details = issue.issueDetails;
|
|
216
216
|
if (details.frame) {
|
|
@@ -220,7 +220,7 @@ export class AttributionReportingIssueDetailsView extends AffectedResourcesView
|
|
|
220
220
|
}
|
|
221
221
|
}
|
|
222
222
|
|
|
223
|
-
|
|
223
|
+
async #appendElementOrEmptyCell(
|
|
224
224
|
parent: HTMLElement, issue: IssuesManager.AttributionReportingIssue.AttributionReportingIssue): Promise<void> {
|
|
225
225
|
const details = issue.issueDetails;
|
|
226
226
|
if (details.violatingNodeId !== undefined) {
|
|
@@ -233,7 +233,7 @@ export class AttributionReportingIssueDetailsView extends AffectedResourcesView
|
|
|
233
233
|
}
|
|
234
234
|
}
|
|
235
235
|
|
|
236
|
-
|
|
236
|
+
#appendRequestOrEmptyCell(parent: HTMLElement, request?: Protocol.Audits.AffectedRequest): void {
|
|
237
237
|
if (!request) {
|
|
238
238
|
this.appendIssueDetailCell(parent, '');
|
|
239
239
|
return;
|
|
@@ -11,15 +11,15 @@ import * as LitHtml from '../../ui/lit-html/lit-html.js';
|
|
|
11
11
|
import cspViolationsListViewStyles from './cspViolationsListView.css.js';
|
|
12
12
|
|
|
13
13
|
export class CSPViolationsListView extends UI.Widget.VBox {
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
14
|
+
#table = new DataGrid.DataGridController.DataGridController();
|
|
15
|
+
#categoryFilter = new Set<string>();
|
|
16
|
+
#issueRows =
|
|
17
17
|
new Map<IssuesManager.ContentSecurityPolicyIssue.ContentSecurityPolicyIssue, DataGrid.DataGridUtils.Row>();
|
|
18
18
|
|
|
19
19
|
constructor() {
|
|
20
20
|
super(true);
|
|
21
21
|
|
|
22
|
-
this
|
|
22
|
+
this.#table.data = {
|
|
23
23
|
columns: [
|
|
24
24
|
{id: 'sourceCode', title: 'Source Code', sortable: false, widthWeighting: 1, visible: true, hideable: false},
|
|
25
25
|
{
|
|
@@ -35,34 +35,33 @@ export class CSPViolationsListView extends UI.Widget.VBox {
|
|
|
35
35
|
],
|
|
36
36
|
rows: [],
|
|
37
37
|
};
|
|
38
|
-
this.contentElement.appendChild(this
|
|
38
|
+
this.contentElement.appendChild(this.#table);
|
|
39
39
|
}
|
|
40
40
|
|
|
41
41
|
updateTextFilter(filter: string): void {
|
|
42
42
|
if (filter.length === 0) {
|
|
43
|
-
this
|
|
43
|
+
this.#table.data = {...this.#table.data, filters: []};
|
|
44
44
|
} else {
|
|
45
|
-
this
|
|
46
|
-
...this
|
|
45
|
+
this.#table.data = {
|
|
46
|
+
...this.#table.data,
|
|
47
47
|
filters: [{text: filter, key: undefined, regex: undefined, negative: false}],
|
|
48
48
|
};
|
|
49
49
|
}
|
|
50
50
|
}
|
|
51
51
|
|
|
52
52
|
updateCategoryFilter(categories: Set<string>): void {
|
|
53
|
-
this
|
|
53
|
+
this.#categoryFilter = categories;
|
|
54
54
|
const rows = [];
|
|
55
|
-
for (const [issue, row] of this
|
|
56
|
-
if (this
|
|
55
|
+
for (const [issue, row] of this.#issueRows.entries()) {
|
|
56
|
+
if (this.#isIssueInFilterCategories(issue)) {
|
|
57
57
|
rows.push(row);
|
|
58
58
|
}
|
|
59
59
|
}
|
|
60
|
-
this
|
|
60
|
+
this.#table.data = {...this.#table.data, rows: rows};
|
|
61
61
|
}
|
|
62
62
|
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
return (this.categoryFilter.has(issue.code()) || this.categoryFilter.size === 0);
|
|
63
|
+
#isIssueInFilterCategories(issue: IssuesManager.ContentSecurityPolicyIssue.ContentSecurityPolicyIssue): boolean {
|
|
64
|
+
return (this.#categoryFilter.has(issue.code()) || this.#categoryFilter.size === 0);
|
|
66
65
|
}
|
|
67
66
|
|
|
68
67
|
addIssue(issue: IssuesManager.ContentSecurityPolicyIssue.ContentSecurityPolicyIssue): void {
|
|
@@ -71,7 +70,7 @@ export class CSPViolationsListView extends UI.Widget.VBox {
|
|
|
71
70
|
return;
|
|
72
71
|
}
|
|
73
72
|
const status = issue.details().isReportOnly ? 'report-only' : 'blocked';
|
|
74
|
-
const category = this
|
|
73
|
+
const category = this.#issueViolationCodeToCategoryName(issue.code());
|
|
75
74
|
const newIssue = {
|
|
76
75
|
cells: [
|
|
77
76
|
{
|
|
@@ -87,20 +86,20 @@ export class CSPViolationsListView extends UI.Widget.VBox {
|
|
|
87
86
|
{columnId: 'status', value: status},
|
|
88
87
|
],
|
|
89
88
|
};
|
|
90
|
-
this
|
|
89
|
+
this.#issueRows.set(issue, newIssue);
|
|
91
90
|
|
|
92
|
-
if (this
|
|
93
|
-
this
|
|
94
|
-
this
|
|
91
|
+
if (this.#isIssueInFilterCategories(issue)) {
|
|
92
|
+
this.#table.data.rows.push(newIssue);
|
|
93
|
+
this.#table.data = {...this.#table.data};
|
|
95
94
|
}
|
|
96
95
|
}
|
|
97
96
|
|
|
98
97
|
clearIssues(): void {
|
|
99
|
-
this
|
|
100
|
-
this
|
|
98
|
+
this.#issueRows.clear();
|
|
99
|
+
this.#table.data = {...this.#table.data, rows: []};
|
|
101
100
|
}
|
|
102
101
|
|
|
103
|
-
|
|
102
|
+
#issueViolationCodeToCategoryName(code: string): string {
|
|
104
103
|
if (code === IssuesManager.ContentSecurityPolicyIssue.inlineViolationCode) {
|
|
105
104
|
return 'Inline Violation';
|
|
106
105
|
}
|
|
@@ -23,8 +23,8 @@ const str_ = i18n.i18n.registerUIStrings('panels/issues/CSPViolationsView.ts', U
|
|
|
23
23
|
const i18nString = i18n.i18n.getLocalizedString.bind(undefined, str_);
|
|
24
24
|
let cspViolationsViewInstance: CSPViolationsView;
|
|
25
25
|
export class CSPViolationsView extends UI.Widget.VBox {
|
|
26
|
-
|
|
27
|
-
|
|
26
|
+
#listView = new CSPViolationsListView();
|
|
27
|
+
#issuesManager = IssuesManager.IssuesManager.IssuesManager.instance();
|
|
28
28
|
|
|
29
29
|
/**
|
|
30
30
|
* @private
|
|
@@ -37,7 +37,7 @@ export class CSPViolationsView extends UI.Widget.VBox {
|
|
|
37
37
|
const topToolbar = new UI.Toolbar.Toolbar('csp-violations-toolbar', this.contentElement);
|
|
38
38
|
const textFilterUI = new UI.Toolbar.ToolbarInput(i18nString(UIStrings.filter), '', 1, .2, '');
|
|
39
39
|
textFilterUI.addEventListener(UI.Toolbar.ToolbarInput.Event.TextChanged, () => {
|
|
40
|
-
this
|
|
40
|
+
this.#listView.updateTextFilter(textFilterUI.value());
|
|
41
41
|
});
|
|
42
42
|
topToolbar.appendToolbarItem(textFilterUI);
|
|
43
43
|
|
|
@@ -55,16 +55,16 @@ export class CSPViolationsView extends UI.Widget.VBox {
|
|
|
55
55
|
});
|
|
56
56
|
levelMenuButton.setOnOptionClicked(() => {
|
|
57
57
|
const categories = new Set(levelMenuButton.getOptions().filter(x => x.enabled).map(x => x.value));
|
|
58
|
-
this
|
|
58
|
+
this.#listView.updateCategoryFilter(categories);
|
|
59
59
|
});
|
|
60
60
|
topToolbar.appendToolbarItem(levelMenuButton);
|
|
61
|
-
this
|
|
61
|
+
this.#listView.show(this.contentElement);
|
|
62
62
|
|
|
63
|
-
this
|
|
64
|
-
this
|
|
65
|
-
IssuesManager.IssuesManager.Events.FullUpdateRequired, this
|
|
63
|
+
this.#issuesManager.addEventListener(IssuesManager.IssuesManager.Events.IssueAdded, this.#onIssueAdded, this);
|
|
64
|
+
this.#issuesManager.addEventListener(
|
|
65
|
+
IssuesManager.IssuesManager.Events.FullUpdateRequired, this.#onFullUpdateRequired, this);
|
|
66
66
|
|
|
67
|
-
this
|
|
67
|
+
this.#addAllIssues();
|
|
68
68
|
}
|
|
69
69
|
|
|
70
70
|
static instance(opts = {forceNew: null}): CSPViolationsView {
|
|
@@ -76,22 +76,22 @@ export class CSPViolationsView extends UI.Widget.VBox {
|
|
|
76
76
|
return cspViolationsViewInstance;
|
|
77
77
|
}
|
|
78
78
|
|
|
79
|
-
|
|
79
|
+
#onIssueAdded(event: Common.EventTarget.EventTargetEvent<IssuesManager.IssuesManager.IssueAddedEvent>): void {
|
|
80
80
|
const {issue} = event.data;
|
|
81
81
|
if (issue instanceof IssuesManager.ContentSecurityPolicyIssue.ContentSecurityPolicyIssue) {
|
|
82
|
-
this
|
|
82
|
+
this.#listView.addIssue(issue);
|
|
83
83
|
}
|
|
84
84
|
}
|
|
85
85
|
|
|
86
|
-
|
|
87
|
-
this
|
|
88
|
-
this
|
|
86
|
+
#onFullUpdateRequired(): void {
|
|
87
|
+
this.#listView.clearIssues();
|
|
88
|
+
this.#addAllIssues();
|
|
89
89
|
}
|
|
90
90
|
|
|
91
|
-
|
|
92
|
-
for (const issue of this
|
|
91
|
+
#addAllIssues(): void {
|
|
92
|
+
for (const issue of this.#issuesManager.issues()) {
|
|
93
93
|
if (issue instanceof IssuesManager.ContentSecurityPolicyIssue.ContentSecurityPolicyIssue) {
|
|
94
|
-
this
|
|
94
|
+
this.#listView.addIssue(issue);
|
|
95
95
|
}
|
|
96
96
|
}
|
|
97
97
|
}
|
|
@@ -6,52 +6,52 @@ import type * as Common from '../../core/common/common.js';
|
|
|
6
6
|
import * as UI from '../../ui/legacy/legacy.js';
|
|
7
7
|
|
|
8
8
|
export class ComboBoxOfCheckBoxes extends UI.Toolbar.ToolbarButton {
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
9
|
+
#options = new Array<MenuOption>();
|
|
10
|
+
#headers = new Array<MenuHeader>();
|
|
11
|
+
#onOptionClicked = (): void => {};
|
|
12
12
|
constructor(title: string) {
|
|
13
13
|
super(title);
|
|
14
14
|
this.turnIntoSelect();
|
|
15
|
-
this.addEventListener(UI.Toolbar.ToolbarButton.Events.Click, this
|
|
15
|
+
this.addEventListener(UI.Toolbar.ToolbarButton.Events.Click, this.#showLevelContextMenu.bind(this));
|
|
16
16
|
UI.ARIAUtils.markAsMenuButton(this.element);
|
|
17
17
|
}
|
|
18
18
|
|
|
19
19
|
addOption(option: string, value: string, defaultEnabled: boolean): void {
|
|
20
|
-
this
|
|
20
|
+
this.#options.push({'title': option, 'value': value, default: defaultEnabled, 'enabled': defaultEnabled});
|
|
21
21
|
}
|
|
22
22
|
|
|
23
23
|
setOptionEnabled(index: number, enabled: boolean): void {
|
|
24
|
-
const option = this
|
|
24
|
+
const option = this.#options[index];
|
|
25
25
|
if (!option) {
|
|
26
26
|
return;
|
|
27
27
|
}
|
|
28
28
|
option.enabled = enabled;
|
|
29
|
-
this
|
|
29
|
+
this.#onOptionClicked();
|
|
30
30
|
}
|
|
31
31
|
|
|
32
32
|
addHeader(headerName: string, callback: (() => void)): void {
|
|
33
|
-
this
|
|
33
|
+
this.#headers.push({title: headerName, callback: callback});
|
|
34
34
|
}
|
|
35
35
|
|
|
36
36
|
setOnOptionClicked(onOptionClicked: (() => void)): void {
|
|
37
|
-
this
|
|
37
|
+
this.#onOptionClicked = onOptionClicked;
|
|
38
38
|
}
|
|
39
39
|
|
|
40
40
|
getOptions(): Array<MenuOption> {
|
|
41
|
-
return this
|
|
41
|
+
return this.#options;
|
|
42
42
|
}
|
|
43
43
|
|
|
44
|
-
|
|
44
|
+
#showLevelContextMenu({data: mouseEvent}: Common.EventTarget.EventTargetEvent<Event>): void {
|
|
45
45
|
const contextMenu = new UI.ContextMenu.ContextMenu(mouseEvent, {
|
|
46
46
|
useSoftMenu: true,
|
|
47
47
|
x: this.element.totalOffsetLeft(),
|
|
48
48
|
y: this.element.totalOffsetTop() + this.element.offsetHeight,
|
|
49
49
|
});
|
|
50
50
|
|
|
51
|
-
for (const {title, callback} of this
|
|
51
|
+
for (const {title, callback} of this.#headers) {
|
|
52
52
|
contextMenu.headerSection().appendCheckboxItem(title, () => callback());
|
|
53
53
|
}
|
|
54
|
-
for (const [index, {title, enabled}] of this
|
|
54
|
+
for (const [index, {title, enabled}] of this.#options.entries()) {
|
|
55
55
|
contextMenu.defaultSection().appendCheckboxItem(title, () => {
|
|
56
56
|
this.setOptionEnabled(index, !enabled);
|
|
57
57
|
}, enabled);
|