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
|
@@ -13,11 +13,11 @@ export const enum IssueCode {
|
|
|
13
13
|
}
|
|
14
14
|
|
|
15
15
|
export class DeprecationIssue extends Issue<IssueCode> {
|
|
16
|
-
|
|
16
|
+
#issueDetails: Protocol.Audits.DeprecationIssueDetails;
|
|
17
17
|
|
|
18
18
|
constructor(issueDetails: Protocol.Audits.DeprecationIssueDetails, issuesModel: SDK.IssuesModel.IssuesModel) {
|
|
19
19
|
super(IssueCode.DeprecationIssue, issuesModel);
|
|
20
|
-
this
|
|
20
|
+
this.#issueDetails = issueDetails;
|
|
21
21
|
}
|
|
22
22
|
|
|
23
23
|
getCategory(): IssueCategory {
|
|
@@ -25,7 +25,7 @@ export class DeprecationIssue extends Issue<IssueCode> {
|
|
|
25
25
|
}
|
|
26
26
|
|
|
27
27
|
details(): Protocol.Audits.DeprecationIssueDetails {
|
|
28
|
-
return this
|
|
28
|
+
return this.#issueDetails;
|
|
29
29
|
}
|
|
30
30
|
|
|
31
31
|
getDescription(): MarkdownIssueDescription|null {
|
|
@@ -34,21 +34,21 @@ export class DeprecationIssue extends Issue<IssueCode> {
|
|
|
34
34
|
substitutions: new Map([
|
|
35
35
|
// TODO(crbug.com/1264960): Re-work format to add i18n support per:
|
|
36
36
|
// https://source.chromium.org/chromium/chromium/src/+/main:third_party/blink/public/devtools_protocol/README.md
|
|
37
|
-
['PLACEHOLDER_message', String(this
|
|
37
|
+
['PLACEHOLDER_message', String(this.#issueDetails.message)],
|
|
38
38
|
]),
|
|
39
39
|
links: [],
|
|
40
40
|
};
|
|
41
41
|
}
|
|
42
42
|
|
|
43
43
|
sources(): Iterable<Protocol.Audits.SourceCodeLocation> {
|
|
44
|
-
if (this
|
|
45
|
-
return [this
|
|
44
|
+
if (this.#issueDetails.sourceCodeLocation) {
|
|
45
|
+
return [this.#issueDetails.sourceCodeLocation];
|
|
46
46
|
}
|
|
47
47
|
return [];
|
|
48
48
|
}
|
|
49
49
|
|
|
50
50
|
primaryKey(): string {
|
|
51
|
-
return JSON.stringify(this
|
|
51
|
+
return JSON.stringify(this.#issueDetails);
|
|
52
52
|
}
|
|
53
53
|
|
|
54
54
|
getKind(): IssueKind {
|
|
@@ -20,7 +20,7 @@ const str_ = i18n.i18n.registerUIStrings('models/issues_manager/GenericIssue.ts'
|
|
|
20
20
|
const i18nLazyString = i18n.i18n.getLazilyComputedLocalizedString.bind(undefined, str_);
|
|
21
21
|
|
|
22
22
|
export class GenericIssue extends Issue {
|
|
23
|
-
|
|
23
|
+
#issueDetails: Protocol.Audits.GenericIssueDetails;
|
|
24
24
|
|
|
25
25
|
constructor(
|
|
26
26
|
issueDetails: Protocol.Audits.GenericIssueDetails, issuesModel: SDK.IssuesModel.IssuesModel,
|
|
@@ -30,7 +30,7 @@ export class GenericIssue extends Issue {
|
|
|
30
30
|
issueDetails.errorType,
|
|
31
31
|
].join('::');
|
|
32
32
|
super(issueCode, issuesModel, issueId);
|
|
33
|
-
this
|
|
33
|
+
this.#issueDetails = issueDetails;
|
|
34
34
|
}
|
|
35
35
|
|
|
36
36
|
getCategory(): IssueCategory {
|
|
@@ -38,11 +38,11 @@ export class GenericIssue extends Issue {
|
|
|
38
38
|
}
|
|
39
39
|
|
|
40
40
|
primaryKey(): string {
|
|
41
|
-
return `${this.code()}-(${this
|
|
41
|
+
return `${this.code()}-(${this.#issueDetails.frameId})`;
|
|
42
42
|
}
|
|
43
43
|
|
|
44
44
|
getDescription(): MarkdownIssueDescription|null {
|
|
45
|
-
const description = issueDescriptions.get(this
|
|
45
|
+
const description = issueDescriptions.get(this.#issueDetails.errorType);
|
|
46
46
|
if (!description) {
|
|
47
47
|
return null;
|
|
48
48
|
}
|
|
@@ -50,7 +50,7 @@ export class GenericIssue extends Issue {
|
|
|
50
50
|
}
|
|
51
51
|
|
|
52
52
|
details(): Protocol.Audits.GenericIssueDetails {
|
|
53
|
-
return this
|
|
53
|
+
return this.#issueDetails;
|
|
54
54
|
}
|
|
55
55
|
|
|
56
56
|
getKind(): IssueKind {
|
|
@@ -19,20 +19,20 @@ const str_ = i18n.i18n.registerUIStrings('models/issues_manager/HeavyAdIssue.ts'
|
|
|
19
19
|
const i18nString = i18n.i18n.getLocalizedString.bind(undefined, str_);
|
|
20
20
|
|
|
21
21
|
export class HeavyAdIssue extends Issue {
|
|
22
|
-
|
|
22
|
+
#issueDetails: Protocol.Audits.HeavyAdIssueDetails;
|
|
23
23
|
|
|
24
24
|
constructor(issueDetails: Protocol.Audits.HeavyAdIssueDetails, issuesModel: SDK.IssuesModel.IssuesModel) {
|
|
25
25
|
const umaCode = [Protocol.Audits.InspectorIssueCode.HeavyAdIssue, issueDetails.reason].join('::');
|
|
26
26
|
super({code: Protocol.Audits.InspectorIssueCode.HeavyAdIssue, umaCode}, issuesModel);
|
|
27
|
-
this
|
|
27
|
+
this.#issueDetails = issueDetails;
|
|
28
28
|
}
|
|
29
29
|
|
|
30
30
|
details(): Protocol.Audits.HeavyAdIssueDetails {
|
|
31
|
-
return this
|
|
31
|
+
return this.#issueDetails;
|
|
32
32
|
}
|
|
33
33
|
|
|
34
34
|
primaryKey(): string {
|
|
35
|
-
return `${Protocol.Audits.InspectorIssueCode.HeavyAdIssue}-${JSON.stringify(this
|
|
35
|
+
return `${Protocol.Audits.InspectorIssueCode.HeavyAdIssue}-${JSON.stringify(this.#issueDetails)}`;
|
|
36
36
|
}
|
|
37
37
|
|
|
38
38
|
getDescription(): MarkdownIssueDescription {
|
|
@@ -52,7 +52,7 @@ export class HeavyAdIssue extends Issue {
|
|
|
52
52
|
}
|
|
53
53
|
|
|
54
54
|
getKind(): IssueKind {
|
|
55
|
-
switch (this
|
|
55
|
+
switch (this.#issueDetails.resolution) {
|
|
56
56
|
case Protocol.Audits.HeavyAdResolutionStatus.HeavyAdBlocked:
|
|
57
57
|
return IssueKind.PageError;
|
|
58
58
|
case Protocol.Audits.HeavyAdResolutionStatus.HeavyAdWarning:
|
|
@@ -123,23 +123,23 @@ export interface AffectedElement {
|
|
|
123
123
|
}
|
|
124
124
|
|
|
125
125
|
export abstract class Issue<IssueCode extends string = string> {
|
|
126
|
-
|
|
127
|
-
|
|
126
|
+
#issueCode: IssueCode;
|
|
127
|
+
#issuesModel: SDK.IssuesModel.IssuesModel|null;
|
|
128
128
|
protected issueId: Protocol.Audits.IssueId|undefined = undefined;
|
|
129
|
-
|
|
129
|
+
#hidden: boolean;
|
|
130
130
|
|
|
131
131
|
constructor(
|
|
132
132
|
code: IssueCode|{code: IssueCode, umaCode: string}, issuesModel: SDK.IssuesModel.IssuesModel|null = null,
|
|
133
133
|
issueId?: Protocol.Audits.IssueId) {
|
|
134
|
-
this
|
|
135
|
-
this
|
|
134
|
+
this.#issueCode = typeof code === 'object' ? code.code : code;
|
|
135
|
+
this.#issuesModel = issuesModel;
|
|
136
136
|
this.issueId = issueId;
|
|
137
137
|
Host.userMetrics.issueCreated(typeof code === 'string' ? code : code.umaCode);
|
|
138
|
-
this
|
|
138
|
+
this.#hidden = false;
|
|
139
139
|
}
|
|
140
140
|
|
|
141
141
|
code(): IssueCode {
|
|
142
|
-
return this
|
|
142
|
+
return this.#issueCode;
|
|
143
143
|
}
|
|
144
144
|
|
|
145
145
|
abstract primaryKey(): string;
|
|
@@ -184,7 +184,7 @@ export abstract class Issue<IssueCode extends string = string> {
|
|
|
184
184
|
* The model might be unavailable or belong to a target that has already been disposed.
|
|
185
185
|
*/
|
|
186
186
|
model(): SDK.IssuesModel.IssuesModel|null {
|
|
187
|
-
return this
|
|
187
|
+
return this.#issuesModel;
|
|
188
188
|
}
|
|
189
189
|
|
|
190
190
|
isCausedByThirdParty(): boolean {
|
|
@@ -196,11 +196,11 @@ export abstract class Issue<IssueCode extends string = string> {
|
|
|
196
196
|
}
|
|
197
197
|
|
|
198
198
|
isHidden(): boolean {
|
|
199
|
-
return this
|
|
199
|
+
return this.#hidden;
|
|
200
200
|
}
|
|
201
201
|
|
|
202
202
|
setHidden(hidden: boolean): void {
|
|
203
|
-
this
|
|
203
|
+
this.#hidden = hidden;
|
|
204
204
|
}
|
|
205
205
|
}
|
|
206
206
|
|
|
@@ -13,19 +13,19 @@ import type {IssueAddedEvent} from './IssuesManager.js';
|
|
|
13
13
|
* A class that facilitates resolving an issueId to an issue. See `ResolverBase` for more info.
|
|
14
14
|
*/
|
|
15
15
|
export class IssueResolver extends Common.ResolverBase.ResolverBase<Protocol.Audits.IssueId, Issue> {
|
|
16
|
-
|
|
17
|
-
|
|
16
|
+
#issuesListener: Common.EventTarget.EventDescriptor|null = null;
|
|
17
|
+
#issuesManager: IssuesManager;
|
|
18
18
|
|
|
19
19
|
constructor(issuesManager: IssuesManager = IssuesManager.instance()) {
|
|
20
20
|
super();
|
|
21
|
-
this
|
|
21
|
+
this.#issuesManager = issuesManager;
|
|
22
22
|
}
|
|
23
23
|
|
|
24
24
|
protected override getForId(id: Protocol.Audits.IssueId): Issue|null {
|
|
25
|
-
return this
|
|
25
|
+
return this.#issuesManager.getIssueById(id) || null;
|
|
26
26
|
}
|
|
27
27
|
|
|
28
|
-
|
|
28
|
+
#onIssueAdded(event: Common.EventTarget.EventTargetEvent<IssueAddedEvent>): void {
|
|
29
29
|
const {issue} = event.data;
|
|
30
30
|
const id = issue.getIssueId();
|
|
31
31
|
if (id) {
|
|
@@ -34,17 +34,18 @@ export class IssueResolver extends Common.ResolverBase.ResolverBase<Protocol.Aud
|
|
|
34
34
|
}
|
|
35
35
|
|
|
36
36
|
protected override startListening(): void {
|
|
37
|
-
if (this
|
|
37
|
+
if (this.#issuesListener) {
|
|
38
38
|
return;
|
|
39
39
|
}
|
|
40
|
-
this
|
|
40
|
+
this.#issuesListener =
|
|
41
|
+
this.#issuesManager.addEventListener(IssueManagerEvents.IssueAdded, this.#onIssueAdded, this);
|
|
41
42
|
}
|
|
42
43
|
|
|
43
44
|
protected override stopListening(): void {
|
|
44
|
-
if (!this
|
|
45
|
+
if (!this.#issuesListener) {
|
|
45
46
|
return;
|
|
46
47
|
}
|
|
47
|
-
Common.EventTarget.removeEventListeners([this
|
|
48
|
-
this
|
|
48
|
+
Common.EventTarget.removeEventListeners([this.#issuesListener]);
|
|
49
|
+
this.#issuesListener = null;
|
|
49
50
|
}
|
|
50
51
|
}
|
|
@@ -160,30 +160,30 @@ export function getHideIssueByCodeSetting(): Common.Settings.Setting<HideIssueMe
|
|
|
160
160
|
*/
|
|
161
161
|
export class IssuesManager extends Common.ObjectWrapper.ObjectWrapper<EventTypes> implements
|
|
162
162
|
SDK.TargetManager.SDKModelObserver<SDK.IssuesModel.IssuesModel> {
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
private issuesById: Map<string, Issue> = new Map();
|
|
163
|
+
#eventListeners = new WeakMap<SDK.IssuesModel.IssuesModel, Common.EventTarget.EventDescriptor>();
|
|
164
|
+
#allIssues = new Map<string, Issue>();
|
|
165
|
+
#filteredIssues = new Map<string, Issue>();
|
|
166
|
+
#issueCounts = new Map<IssueKind, number>();
|
|
167
|
+
#hiddenIssueCount = new Map<IssueKind, number>();
|
|
168
|
+
#hasSeenTopFrameNavigated = false;
|
|
169
|
+
#issuesById: Map<string, Issue> = new Map();
|
|
171
170
|
|
|
172
171
|
constructor(
|
|
173
172
|
private readonly showThirdPartyIssuesSetting?: Common.Settings.Setting<boolean>,
|
|
174
173
|
private readonly hideIssueSetting?: Common.Settings.Setting<HideIssueMenuSetting>) {
|
|
175
174
|
super();
|
|
175
|
+
new SourceFrameIssuesManager(this);
|
|
176
176
|
SDK.TargetManager.TargetManager.instance().observeModels(SDK.IssuesModel.IssuesModel, this);
|
|
177
177
|
SDK.FrameManager.FrameManager.instance().addEventListener(
|
|
178
|
-
SDK.FrameManager.Events.TopFrameNavigated, this
|
|
178
|
+
SDK.FrameManager.Events.TopFrameNavigated, this.#onTopFrameNavigated, this);
|
|
179
179
|
SDK.FrameManager.FrameManager.instance().addEventListener(
|
|
180
|
-
SDK.FrameManager.Events.FrameAddedToTarget, this
|
|
180
|
+
SDK.FrameManager.Events.FrameAddedToTarget, this.#onFrameAddedToTarget, this);
|
|
181
181
|
|
|
182
182
|
// issueFilter uses the 'showThirdPartyIssues' setting. Clients of IssuesManager need
|
|
183
183
|
// a full update when the setting changes to get an up-to-date issues list.
|
|
184
|
-
this.showThirdPartyIssuesSetting?.addChangeListener(() => this
|
|
184
|
+
this.showThirdPartyIssuesSetting?.addChangeListener(() => this.#updateFilteredIssues());
|
|
185
185
|
if (Root.Runtime.experiments.isEnabled('hideIssuesFeature')) {
|
|
186
|
-
this.hideIssueSetting?.addChangeListener(() => this
|
|
186
|
+
this.hideIssueSetting?.addChangeListener(() => this.#updateFilteredIssues());
|
|
187
187
|
}
|
|
188
188
|
}
|
|
189
189
|
|
|
@@ -210,48 +210,48 @@ export class IssuesManager extends Common.ObjectWrapper.ObjectWrapper<EventTypes
|
|
|
210
210
|
* during navigation.
|
|
211
211
|
*/
|
|
212
212
|
reloadForAccurateInformationRequired(): boolean {
|
|
213
|
-
return !this
|
|
213
|
+
return !this.#hasSeenTopFrameNavigated;
|
|
214
214
|
}
|
|
215
215
|
|
|
216
|
-
|
|
217
|
-
|
|
216
|
+
#onTopFrameNavigated(event: Common.EventTarget.EventTargetEvent<{frame: SDK.ResourceTreeModel.ResourceTreeFrame}>):
|
|
217
|
+
void {
|
|
218
218
|
const {frame} = event.data;
|
|
219
219
|
const keptIssues = new Map<string, Issue>();
|
|
220
|
-
for (const [key, issue] of this
|
|
220
|
+
for (const [key, issue] of this.#allIssues.entries()) {
|
|
221
221
|
if (issue.isAssociatedWithRequestId(frame.loaderId)) {
|
|
222
222
|
keptIssues.set(key, issue);
|
|
223
223
|
}
|
|
224
224
|
}
|
|
225
|
-
this
|
|
226
|
-
this
|
|
227
|
-
this
|
|
225
|
+
this.#allIssues = keptIssues;
|
|
226
|
+
this.#hasSeenTopFrameNavigated = true;
|
|
227
|
+
this.#updateFilteredIssues();
|
|
228
228
|
}
|
|
229
229
|
|
|
230
|
-
|
|
231
|
-
|
|
230
|
+
#onFrameAddedToTarget(event: Common.EventTarget.EventTargetEvent<{frame: SDK.ResourceTreeModel.ResourceTreeFrame}>):
|
|
231
|
+
void {
|
|
232
232
|
const {frame} = event.data;
|
|
233
233
|
// Determining third-party status usually requires the registered domain of the top frame.
|
|
234
234
|
// When DevTools is opened after navigation has completed, issues may be received
|
|
235
235
|
// before the top frame is available. Thus, we trigger a recalcuation of third-party-ness
|
|
236
236
|
// when we attach to the top frame.
|
|
237
237
|
if (frame.isTopFrame()) {
|
|
238
|
-
this
|
|
238
|
+
this.#updateFilteredIssues();
|
|
239
239
|
}
|
|
240
240
|
}
|
|
241
241
|
|
|
242
242
|
modelAdded(issuesModel: SDK.IssuesModel.IssuesModel): void {
|
|
243
|
-
const listener = issuesModel.addEventListener(SDK.IssuesModel.Events.IssueAdded, this
|
|
244
|
-
this
|
|
243
|
+
const listener = issuesModel.addEventListener(SDK.IssuesModel.Events.IssueAdded, this.#onIssueAddedEvent, this);
|
|
244
|
+
this.#eventListeners.set(issuesModel, listener);
|
|
245
245
|
}
|
|
246
246
|
|
|
247
247
|
modelRemoved(issuesModel: SDK.IssuesModel.IssuesModel): void {
|
|
248
|
-
const listener = this
|
|
248
|
+
const listener = this.#eventListeners.get(issuesModel);
|
|
249
249
|
if (listener) {
|
|
250
250
|
Common.EventTarget.removeEventListeners([listener]);
|
|
251
251
|
}
|
|
252
252
|
}
|
|
253
253
|
|
|
254
|
-
|
|
254
|
+
#onIssueAddedEvent(event: Common.EventTarget.EventTargetEvent<SDK.IssuesModel.IssueAddedEvent>): void {
|
|
255
255
|
const {issuesModel, inspectorIssue} = event.data;
|
|
256
256
|
const issues = createIssuesFromProtocolIssue(issuesModel, inspectorIssue);
|
|
257
257
|
for (const issue of issues) {
|
|
@@ -265,25 +265,25 @@ export class IssuesManager extends Common.ObjectWrapper.ObjectWrapper<EventTypes
|
|
|
265
265
|
return;
|
|
266
266
|
}
|
|
267
267
|
const primaryKey = issue.primaryKey();
|
|
268
|
-
if (this
|
|
268
|
+
if (this.#allIssues.has(primaryKey)) {
|
|
269
269
|
return;
|
|
270
270
|
}
|
|
271
|
-
this
|
|
271
|
+
this.#allIssues.set(primaryKey, issue);
|
|
272
272
|
|
|
273
|
-
if (this
|
|
274
|
-
this
|
|
275
|
-
this
|
|
273
|
+
if (this.#issueFilter(issue)) {
|
|
274
|
+
this.#filteredIssues.set(primaryKey, issue);
|
|
275
|
+
this.#issueCounts.set(issue.getKind(), 1 + (this.#issueCounts.get(issue.getKind()) || 0));
|
|
276
276
|
const issueId = issue.getIssueId();
|
|
277
277
|
if (issueId) {
|
|
278
|
-
this
|
|
278
|
+
this.#issuesById.set(issueId, issue);
|
|
279
279
|
}
|
|
280
280
|
const values = this.hideIssueSetting?.get();
|
|
281
281
|
const hideIssuesFeature = Root.Runtime.experiments.isEnabled('hideIssuesFeature');
|
|
282
282
|
if (hideIssuesFeature) {
|
|
283
|
-
this
|
|
283
|
+
this.#updateIssueHiddenStatus(issue, values);
|
|
284
284
|
}
|
|
285
285
|
if (issue.isHidden()) {
|
|
286
|
-
this
|
|
286
|
+
this.#hiddenIssueCount.set(issue.getKind(), 1 + (this.#hiddenIssueCount.get(issue.getKind()) || 0));
|
|
287
287
|
}
|
|
288
288
|
this.dispatchEventToListeners(Events.IssueAdded, {issuesModel, issue});
|
|
289
289
|
}
|
|
@@ -293,36 +293,36 @@ export class IssuesManager extends Common.ObjectWrapper.ObjectWrapper<EventTypes
|
|
|
293
293
|
}
|
|
294
294
|
|
|
295
295
|
issues(): Iterable<Issue> {
|
|
296
|
-
return this
|
|
296
|
+
return this.#filteredIssues.values();
|
|
297
297
|
}
|
|
298
298
|
|
|
299
299
|
numberOfIssues(kind?: IssueKind): number {
|
|
300
300
|
if (kind) {
|
|
301
|
-
return (this
|
|
301
|
+
return (this.#issueCounts.get(kind) ?? 0) - this.numberOfHiddenIssues(kind);
|
|
302
302
|
}
|
|
303
|
-
return this
|
|
303
|
+
return this.#filteredIssues.size - this.numberOfHiddenIssues();
|
|
304
304
|
}
|
|
305
305
|
|
|
306
306
|
numberOfHiddenIssues(kind?: IssueKind): number {
|
|
307
307
|
if (kind) {
|
|
308
|
-
return this
|
|
308
|
+
return this.#hiddenIssueCount.get(kind) ?? 0;
|
|
309
309
|
}
|
|
310
310
|
let count = 0;
|
|
311
|
-
for (const num of this
|
|
311
|
+
for (const num of this.#hiddenIssueCount.values()) {
|
|
312
312
|
count += num;
|
|
313
313
|
}
|
|
314
314
|
return count;
|
|
315
315
|
}
|
|
316
316
|
|
|
317
317
|
numberOfAllStoredIssues(): number {
|
|
318
|
-
return this
|
|
318
|
+
return this.#allIssues.size;
|
|
319
319
|
}
|
|
320
320
|
|
|
321
|
-
|
|
321
|
+
#issueFilter(issue: Issue): boolean {
|
|
322
322
|
return this.showThirdPartyIssuesSetting?.get() || !issue.isCausedByThirdParty();
|
|
323
323
|
}
|
|
324
324
|
|
|
325
|
-
|
|
325
|
+
#updateIssueHiddenStatus(issue: Issue, values: HideIssueMenuSetting|undefined): void {
|
|
326
326
|
const code = issue.code();
|
|
327
327
|
// All issues are hidden via their code.
|
|
328
328
|
// For hiding we check whether the issue code is present and has a value of IssueStatus.Hidden
|
|
@@ -340,26 +340,26 @@ export class IssuesManager extends Common.ObjectWrapper.ObjectWrapper<EventTypes
|
|
|
340
340
|
}
|
|
341
341
|
}
|
|
342
342
|
|
|
343
|
-
|
|
344
|
-
this
|
|
345
|
-
this
|
|
346
|
-
this
|
|
347
|
-
this
|
|
343
|
+
#updateFilteredIssues(): void {
|
|
344
|
+
this.#filteredIssues.clear();
|
|
345
|
+
this.#issueCounts.clear();
|
|
346
|
+
this.#issuesById.clear();
|
|
347
|
+
this.#hiddenIssueCount.clear();
|
|
348
348
|
const values = this.hideIssueSetting?.get();
|
|
349
349
|
const hideIssuesFeature = Root.Runtime.experiments.isEnabled('hideIssuesFeature');
|
|
350
|
-
for (const [key, issue] of this
|
|
351
|
-
if (this
|
|
350
|
+
for (const [key, issue] of this.#allIssues) {
|
|
351
|
+
if (this.#issueFilter(issue)) {
|
|
352
352
|
if (hideIssuesFeature) {
|
|
353
|
-
this
|
|
353
|
+
this.#updateIssueHiddenStatus(issue, values);
|
|
354
354
|
}
|
|
355
|
-
this
|
|
356
|
-
this
|
|
355
|
+
this.#filteredIssues.set(key, issue);
|
|
356
|
+
this.#issueCounts.set(issue.getKind(), 1 + (this.#issueCounts.get(issue.getKind()) ?? 0));
|
|
357
357
|
if (issue.isHidden()) {
|
|
358
|
-
this
|
|
358
|
+
this.#hiddenIssueCount.set(issue.getKind(), 1 + (this.#hiddenIssueCount.get(issue.getKind()) || 0));
|
|
359
359
|
}
|
|
360
360
|
const issueId = issue.getIssueId();
|
|
361
361
|
if (issueId) {
|
|
362
|
-
this
|
|
362
|
+
this.#issuesById.set(issueId, issue);
|
|
363
363
|
}
|
|
364
364
|
}
|
|
365
365
|
}
|
|
@@ -368,14 +368,14 @@ export class IssuesManager extends Common.ObjectWrapper.ObjectWrapper<EventTypes
|
|
|
368
368
|
}
|
|
369
369
|
|
|
370
370
|
unhideAllIssues(): void {
|
|
371
|
-
for (const issue of this
|
|
371
|
+
for (const issue of this.#allIssues.values()) {
|
|
372
372
|
issue.setHidden(false);
|
|
373
373
|
}
|
|
374
374
|
this.hideIssueSetting?.set(defaultHideIssueByCodeSetting());
|
|
375
375
|
}
|
|
376
376
|
|
|
377
377
|
getIssueById(id: string): Issue|undefined {
|
|
378
|
-
return this
|
|
378
|
+
return this.#issuesById.get(id);
|
|
379
379
|
}
|
|
380
380
|
}
|
|
381
381
|
|
|
@@ -19,17 +19,17 @@ const str_ = i18n.i18n.registerUIStrings('models/issues_manager/LowTextContrastI
|
|
|
19
19
|
const i18nString = i18n.i18n.getLocalizedString.bind(undefined, str_);
|
|
20
20
|
|
|
21
21
|
export class LowTextContrastIssue extends Issue {
|
|
22
|
-
|
|
22
|
+
#issueDetails: Protocol.Audits.LowTextContrastIssueDetails;
|
|
23
23
|
|
|
24
24
|
constructor(issueDetails: Protocol.Audits.LowTextContrastIssueDetails, issuesModel: SDK.IssuesModel.IssuesModel) {
|
|
25
25
|
super('LowTextContrastIssue', issuesModel);
|
|
26
|
-
this
|
|
26
|
+
this.#issueDetails = issueDetails;
|
|
27
27
|
}
|
|
28
28
|
|
|
29
29
|
primaryKey(): string {
|
|
30
30
|
// We intend to keep only one issue per element so other issues for the element will be discarded even
|
|
31
31
|
// if the issue content is slightly different.
|
|
32
|
-
return `${this.code()}-(${this
|
|
32
|
+
return `${this.code()}-(${this.#issueDetails.violatingNodeId})`;
|
|
33
33
|
}
|
|
34
34
|
|
|
35
35
|
getCategory(): IssueCategory {
|
|
@@ -37,7 +37,7 @@ export class LowTextContrastIssue extends Issue {
|
|
|
37
37
|
}
|
|
38
38
|
|
|
39
39
|
details(): Protocol.Audits.LowTextContrastIssueDetails {
|
|
40
|
-
return this
|
|
40
|
+
return this.#issueDetails;
|
|
41
41
|
}
|
|
42
42
|
|
|
43
43
|
getDescription(): MarkdownIssueDescription {
|
|
@@ -19,22 +19,22 @@ const str_ = i18n.i18n.registerUIStrings('models/issues_manager/MixedContentIssu
|
|
|
19
19
|
const i18nString = i18n.i18n.getLocalizedString.bind(undefined, str_);
|
|
20
20
|
|
|
21
21
|
export class MixedContentIssue extends Issue {
|
|
22
|
-
|
|
22
|
+
#issueDetails: Protocol.Audits.MixedContentIssueDetails;
|
|
23
23
|
|
|
24
24
|
constructor(issueDetails: Protocol.Audits.MixedContentIssueDetails, issuesModel: SDK.IssuesModel.IssuesModel) {
|
|
25
25
|
super(Protocol.Audits.InspectorIssueCode.MixedContentIssue, issuesModel);
|
|
26
|
-
this
|
|
26
|
+
this.#issueDetails = issueDetails;
|
|
27
27
|
}
|
|
28
28
|
|
|
29
29
|
requests(): Iterable<Protocol.Audits.AffectedRequest> {
|
|
30
|
-
if (this
|
|
31
|
-
return [this
|
|
30
|
+
if (this.#issueDetails.request) {
|
|
31
|
+
return [this.#issueDetails.request];
|
|
32
32
|
}
|
|
33
33
|
return [];
|
|
34
34
|
}
|
|
35
35
|
|
|
36
36
|
getDetails(): Protocol.Audits.MixedContentIssueDetails {
|
|
37
|
-
return this
|
|
37
|
+
return this.#issueDetails;
|
|
38
38
|
}
|
|
39
39
|
|
|
40
40
|
getCategory(): IssueCategory {
|
|
@@ -50,11 +50,11 @@ export class MixedContentIssue extends Issue {
|
|
|
50
50
|
}
|
|
51
51
|
|
|
52
52
|
primaryKey(): string {
|
|
53
|
-
return JSON.stringify(this
|
|
53
|
+
return JSON.stringify(this.#issueDetails);
|
|
54
54
|
}
|
|
55
55
|
|
|
56
56
|
getKind(): IssueKind {
|
|
57
|
-
switch (this
|
|
57
|
+
switch (this.#issueDetails.resolutionStatus) {
|
|
58
58
|
case Protocol.Audits.MixedContentResolutionStatus.MixedContentAutomaticallyUpgraded:
|
|
59
59
|
return IssueKind.Improvement;
|
|
60
60
|
case Protocol.Audits.MixedContentResolutionStatus.MixedContentBlocked:
|
|
@@ -27,11 +27,11 @@ export enum IssueCode {
|
|
|
27
27
|
}
|
|
28
28
|
|
|
29
29
|
export class NavigatorUserAgentIssue extends Issue<IssueCode> {
|
|
30
|
-
|
|
30
|
+
#issueDetails: Protocol.Audits.NavigatorUserAgentIssueDetails;
|
|
31
31
|
|
|
32
32
|
constructor(issueDetails: Protocol.Audits.NavigatorUserAgentIssueDetails, issuesModel: SDK.IssuesModel.IssuesModel) {
|
|
33
33
|
super(IssueCode.NavigatorUserAgentIssue, issuesModel);
|
|
34
|
-
this
|
|
34
|
+
this.#issueDetails = issueDetails;
|
|
35
35
|
}
|
|
36
36
|
|
|
37
37
|
getCategory(): IssueCategory {
|
|
@@ -39,7 +39,7 @@ export class NavigatorUserAgentIssue extends Issue<IssueCode> {
|
|
|
39
39
|
}
|
|
40
40
|
|
|
41
41
|
details(): Protocol.Audits.NavigatorUserAgentIssueDetails {
|
|
42
|
-
return this
|
|
42
|
+
return this.#issueDetails;
|
|
43
43
|
}
|
|
44
44
|
|
|
45
45
|
getDescription(): MarkdownIssueDescription|null {
|
|
@@ -53,14 +53,14 @@ export class NavigatorUserAgentIssue extends Issue<IssueCode> {
|
|
|
53
53
|
}
|
|
54
54
|
|
|
55
55
|
sources(): Iterable<Protocol.Audits.SourceCodeLocation> {
|
|
56
|
-
if (this
|
|
57
|
-
return [this
|
|
56
|
+
if (this.#issueDetails.location) {
|
|
57
|
+
return [this.#issueDetails.location];
|
|
58
58
|
}
|
|
59
59
|
return [];
|
|
60
60
|
}
|
|
61
61
|
|
|
62
62
|
primaryKey(): string {
|
|
63
|
-
return JSON.stringify(this
|
|
63
|
+
return JSON.stringify(this.#issueDetails);
|
|
64
64
|
}
|
|
65
65
|
|
|
66
66
|
getKind(): IssueKind {
|
|
@@ -69,7 +69,7 @@ export class NavigatorUserAgentIssue extends Issue<IssueCode> {
|
|
|
69
69
|
|
|
70
70
|
isCausedByThirdParty(): boolean {
|
|
71
71
|
const topFrame = SDK.FrameManager.FrameManager.instance().getTopFrame();
|
|
72
|
-
return isCausedByThirdParty(topFrame, this
|
|
72
|
+
return isCausedByThirdParty(topFrame, this.#issueDetails.url);
|
|
73
73
|
}
|
|
74
74
|
|
|
75
75
|
static fromInspectorIssue(issuesModel: SDK.IssuesModel.IssuesModel, inspectorIssue: Protocol.Audits.InspectorIssue):
|
|
@@ -19,17 +19,17 @@ const str_ = i18n.i18n.registerUIStrings('models/issues_manager/QuirksModeIssue.
|
|
|
19
19
|
const i18nString = i18n.i18n.getLocalizedString.bind(undefined, str_);
|
|
20
20
|
|
|
21
21
|
export class QuirksModeIssue extends Issue {
|
|
22
|
-
|
|
22
|
+
#issueDetails: Protocol.Audits.QuirksModeIssueDetails;
|
|
23
23
|
|
|
24
24
|
constructor(issueDetails: Protocol.Audits.QuirksModeIssueDetails, issuesModel: SDK.IssuesModel.IssuesModel) {
|
|
25
25
|
const mode = issueDetails.isLimitedQuirksMode ? 'LimitedQuirksMode' : 'QuirksMode';
|
|
26
26
|
const umaCode = [Protocol.Audits.InspectorIssueCode.QuirksModeIssue, mode].join('::');
|
|
27
27
|
super({code: Protocol.Audits.InspectorIssueCode.QuirksModeIssue, umaCode}, issuesModel);
|
|
28
|
-
this
|
|
28
|
+
this.#issueDetails = issueDetails;
|
|
29
29
|
}
|
|
30
30
|
|
|
31
31
|
primaryKey(): string {
|
|
32
|
-
return `${this.code()}-(${this
|
|
32
|
+
return `${this.code()}-(${this.#issueDetails.documentNodeId})-(${this.#issueDetails.url})`;
|
|
33
33
|
}
|
|
34
34
|
|
|
35
35
|
getCategory(): IssueCategory {
|
|
@@ -37,7 +37,7 @@ export class QuirksModeIssue extends Issue {
|
|
|
37
37
|
}
|
|
38
38
|
|
|
39
39
|
details(): Protocol.Audits.QuirksModeIssueDetails {
|
|
40
|
-
return this
|
|
40
|
+
return this.#issueDetails;
|
|
41
41
|
}
|
|
42
42
|
|
|
43
43
|
getDescription(): MarkdownIssueDescription {
|