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
|
@@ -38,27 +38,27 @@ const str_ = i18n.i18n.registerUIStrings('models/issues_manager/SameSiteCookieIs
|
|
|
38
38
|
const i18nLazyString = i18n.i18n.getLazilyComputedLocalizedString.bind(undefined, str_);
|
|
39
39
|
|
|
40
40
|
export class SameSiteCookieIssue extends Issue {
|
|
41
|
-
|
|
41
|
+
#issueDetails: Protocol.Audits.SameSiteCookieIssueDetails;
|
|
42
42
|
|
|
43
43
|
constructor(
|
|
44
44
|
code: string, issueDetails: Protocol.Audits.SameSiteCookieIssueDetails,
|
|
45
45
|
issuesModel: SDK.IssuesModel.IssuesModel) {
|
|
46
46
|
super(code, issuesModel);
|
|
47
|
-
this
|
|
47
|
+
this.#issueDetails = issueDetails;
|
|
48
48
|
}
|
|
49
49
|
|
|
50
|
-
|
|
51
|
-
if (this
|
|
52
|
-
const {domain, path, name} = this
|
|
50
|
+
#cookieId(): string {
|
|
51
|
+
if (this.#issueDetails.cookie) {
|
|
52
|
+
const {domain, path, name} = this.#issueDetails.cookie;
|
|
53
53
|
const cookieId = `${domain};${path};${name}`;
|
|
54
54
|
return cookieId;
|
|
55
55
|
}
|
|
56
|
-
return this
|
|
56
|
+
return this.#issueDetails.rawCookieLine ?? 'no-cookie-info';
|
|
57
57
|
}
|
|
58
58
|
|
|
59
59
|
primaryKey(): string {
|
|
60
|
-
const requestId = this
|
|
61
|
-
return `${this.code()}-(${this
|
|
60
|
+
const requestId = this.#issueDetails.request ? this.#issueDetails.request.requestId : 'no-request';
|
|
61
|
+
return `${this.code()}-(${this.#cookieId()})-(${requestId})`;
|
|
62
62
|
}
|
|
63
63
|
|
|
64
64
|
/**
|
|
@@ -162,22 +162,22 @@ export class SameSiteCookieIssue extends Issue {
|
|
|
162
162
|
}
|
|
163
163
|
|
|
164
164
|
cookies(): Iterable<Protocol.Audits.AffectedCookie> {
|
|
165
|
-
if (this
|
|
166
|
-
return [this
|
|
165
|
+
if (this.#issueDetails.cookie) {
|
|
166
|
+
return [this.#issueDetails.cookie];
|
|
167
167
|
}
|
|
168
168
|
return [];
|
|
169
169
|
}
|
|
170
170
|
|
|
171
171
|
rawCookieLines(): Iterable<string> {
|
|
172
|
-
if (this
|
|
173
|
-
return [this
|
|
172
|
+
if (this.#issueDetails.rawCookieLine) {
|
|
173
|
+
return [this.#issueDetails.rawCookieLine];
|
|
174
174
|
}
|
|
175
175
|
return [];
|
|
176
176
|
}
|
|
177
177
|
|
|
178
178
|
requests(): Iterable<Protocol.Audits.AffectedRequest> {
|
|
179
|
-
if (this
|
|
180
|
-
return [this
|
|
179
|
+
if (this.#issueDetails.request) {
|
|
180
|
+
return [this.#issueDetails.request];
|
|
181
181
|
}
|
|
182
182
|
return [];
|
|
183
183
|
}
|
|
@@ -196,11 +196,11 @@ export class SameSiteCookieIssue extends Issue {
|
|
|
196
196
|
|
|
197
197
|
isCausedByThirdParty(): boolean {
|
|
198
198
|
const topFrame = SDK.FrameManager.FrameManager.instance().getTopFrame();
|
|
199
|
-
return isCausedByThirdParty(topFrame, this
|
|
199
|
+
return isCausedByThirdParty(topFrame, this.#issueDetails.cookieUrl);
|
|
200
200
|
}
|
|
201
201
|
|
|
202
202
|
getKind(): IssueKind {
|
|
203
|
-
if (this
|
|
203
|
+
if (this.#issueDetails.cookieExclusionReasons?.length > 0) {
|
|
204
204
|
return IssueKind.PageError;
|
|
205
205
|
}
|
|
206
206
|
return IssueKind.BreakingChange;
|
|
@@ -20,12 +20,12 @@ const str_ = i18n.i18n.registerUIStrings('models/issues_manager/SharedArrayBuffe
|
|
|
20
20
|
const i18nString = i18n.i18n.getLocalizedString.bind(undefined, str_);
|
|
21
21
|
|
|
22
22
|
export class SharedArrayBufferIssue extends Issue {
|
|
23
|
-
|
|
23
|
+
#issueDetails: Protocol.Audits.SharedArrayBufferIssueDetails;
|
|
24
24
|
|
|
25
25
|
constructor(issueDetails: Protocol.Audits.SharedArrayBufferIssueDetails, issuesModel: SDK.IssuesModel.IssuesModel) {
|
|
26
26
|
const umaCode = [Protocol.Audits.InspectorIssueCode.SharedArrayBufferIssue, issueDetails.type].join('::');
|
|
27
27
|
super({code: Protocol.Audits.InspectorIssueCode.SharedArrayBufferIssue, umaCode}, issuesModel);
|
|
28
|
-
this
|
|
28
|
+
this.#issueDetails = issueDetails;
|
|
29
29
|
}
|
|
30
30
|
|
|
31
31
|
getCategory(): IssueCategory {
|
|
@@ -33,7 +33,7 @@ export class SharedArrayBufferIssue extends Issue {
|
|
|
33
33
|
}
|
|
34
34
|
|
|
35
35
|
details(): Protocol.Audits.SharedArrayBufferIssueDetails {
|
|
36
|
-
return this
|
|
36
|
+
return this.#issueDetails;
|
|
37
37
|
}
|
|
38
38
|
|
|
39
39
|
getDescription(): MarkdownIssueDescription {
|
|
@@ -47,11 +47,11 @@ export class SharedArrayBufferIssue extends Issue {
|
|
|
47
47
|
}
|
|
48
48
|
|
|
49
49
|
primaryKey(): string {
|
|
50
|
-
return JSON.stringify(this
|
|
50
|
+
return JSON.stringify(this.#issueDetails);
|
|
51
51
|
}
|
|
52
52
|
|
|
53
53
|
getKind(): IssueKind {
|
|
54
|
-
if (this
|
|
54
|
+
if (this.#issueDetails.isWarning) {
|
|
55
55
|
return IssueKind.BreakingChange;
|
|
56
56
|
}
|
|
57
57
|
return IssueKind.PageError;
|
|
@@ -16,21 +16,21 @@ import {Events} from './IssuesManagerEvents.js';
|
|
|
16
16
|
import {getIssueTitleFromMarkdownDescription} from './MarkdownIssueDescription.js';
|
|
17
17
|
|
|
18
18
|
export class SourceFrameIssuesManager {
|
|
19
|
-
|
|
20
|
-
|
|
19
|
+
#locationPool = new Bindings.LiveLocation.LiveLocationPool();
|
|
20
|
+
#issueMessages = new Array<IssueMessage>();
|
|
21
21
|
|
|
22
22
|
constructor(private readonly issuesManager: IssuesManager) {
|
|
23
|
-
this.issuesManager.addEventListener(Events.IssueAdded, this
|
|
24
|
-
this.issuesManager.addEventListener(Events.FullUpdateRequired, this
|
|
23
|
+
this.issuesManager.addEventListener(Events.IssueAdded, this.#onIssueAdded, this);
|
|
24
|
+
this.issuesManager.addEventListener(Events.FullUpdateRequired, this.#onFullUpdateRequired, this);
|
|
25
25
|
}
|
|
26
26
|
|
|
27
|
-
|
|
27
|
+
#onIssueAdded(event: Common.EventTarget.EventTargetEvent<IssueAddedEvent>): void {
|
|
28
28
|
const {issue} = event.data;
|
|
29
|
-
this
|
|
29
|
+
this.#addIssue(issue);
|
|
30
30
|
}
|
|
31
31
|
|
|
32
|
-
|
|
33
|
-
if (!this
|
|
32
|
+
#addIssue(issue: Issue): void {
|
|
33
|
+
if (!this.#isTrustedTypeIssue(issue)) {
|
|
34
34
|
return;
|
|
35
35
|
}
|
|
36
36
|
const issuesModel = issue.model();
|
|
@@ -43,20 +43,20 @@ export class SourceFrameIssuesManager {
|
|
|
43
43
|
const rawLocation =
|
|
44
44
|
debuggerModel.createRawLocationByURL(srcLocation.url, srcLocation.lineNumber, srcLocation.columnNumber);
|
|
45
45
|
if (rawLocation) {
|
|
46
|
-
this
|
|
46
|
+
this.#addIssueMessageToScript(issue, rawLocation);
|
|
47
47
|
}
|
|
48
48
|
}
|
|
49
49
|
}
|
|
50
50
|
|
|
51
|
-
|
|
52
|
-
this
|
|
51
|
+
#onFullUpdateRequired(): void {
|
|
52
|
+
this.#resetMessages();
|
|
53
53
|
const issues = this.issuesManager.issues();
|
|
54
54
|
for (const issue of issues) {
|
|
55
|
-
this
|
|
55
|
+
this.#addIssue(issue);
|
|
56
56
|
}
|
|
57
57
|
}
|
|
58
58
|
|
|
59
|
-
|
|
59
|
+
async #addIssueMessageToScript(issue: Issue, rawLocation: SDK.DebuggerModel.Location): Promise<void> {
|
|
60
60
|
const description = issue.getDescription();
|
|
61
61
|
if (description) {
|
|
62
62
|
const title = await getIssueTitleFromMarkdownDescription(description);
|
|
@@ -64,58 +64,59 @@ export class SourceFrameIssuesManager {
|
|
|
64
64
|
const clickHandler = (): void => {
|
|
65
65
|
Common.Revealer.reveal(issue);
|
|
66
66
|
};
|
|
67
|
-
this
|
|
67
|
+
this.#issueMessages.push(
|
|
68
|
+
new IssueMessage(title, issue.getKind(), rawLocation, this.#locationPool, clickHandler));
|
|
68
69
|
}
|
|
69
70
|
}
|
|
70
71
|
}
|
|
71
72
|
|
|
72
|
-
|
|
73
|
+
#isTrustedTypeIssue(issue: Issue): issue is ContentSecurityPolicyIssue {
|
|
73
74
|
return issue instanceof ContentSecurityPolicyIssue && issue.code() === trustedTypesSinkViolationCode ||
|
|
74
75
|
issue.code() === trustedTypesPolicyViolationCode;
|
|
75
76
|
}
|
|
76
77
|
|
|
77
|
-
|
|
78
|
-
for (const message of this
|
|
78
|
+
#resetMessages(): void {
|
|
79
|
+
for (const message of this.#issueMessages) {
|
|
79
80
|
message.dispose();
|
|
80
81
|
}
|
|
81
|
-
this
|
|
82
|
-
this
|
|
82
|
+
this.#issueMessages = [];
|
|
83
|
+
this.#locationPool.disposeAll();
|
|
83
84
|
}
|
|
84
85
|
}
|
|
85
86
|
|
|
86
87
|
export class IssueMessage extends Workspace.UISourceCode.Message {
|
|
87
|
-
|
|
88
|
-
|
|
88
|
+
#uiSourceCode?: Workspace.UISourceCode.UISourceCode = undefined;
|
|
89
|
+
#kind: IssueKind;
|
|
89
90
|
|
|
90
91
|
constructor(
|
|
91
92
|
title: string, kind: IssueKind, rawLocation: SDK.DebuggerModel.Location,
|
|
92
93
|
locationPool: Bindings.LiveLocation.LiveLocationPool, clickHandler: () => void) {
|
|
93
94
|
super(Workspace.UISourceCode.Message.Level.Issue, title, clickHandler);
|
|
94
|
-
this
|
|
95
|
+
this.#kind = kind;
|
|
95
96
|
Bindings.DebuggerWorkspaceBinding.DebuggerWorkspaceBinding.instance().createLiveLocation(
|
|
96
|
-
rawLocation, this
|
|
97
|
+
rawLocation, this.#updateLocation.bind(this), locationPool);
|
|
97
98
|
}
|
|
98
99
|
|
|
99
|
-
|
|
100
|
-
if (this
|
|
101
|
-
this
|
|
100
|
+
async #updateLocation(liveLocation: Bindings.LiveLocation.LiveLocation): Promise<void> {
|
|
101
|
+
if (this.#uiSourceCode) {
|
|
102
|
+
this.#uiSourceCode.removeMessage(this);
|
|
102
103
|
}
|
|
103
104
|
const uiLocation = await liveLocation.uiLocation();
|
|
104
105
|
if (!uiLocation) {
|
|
105
106
|
return;
|
|
106
107
|
}
|
|
107
108
|
this.range = TextUtils.TextRange.TextRange.createFromLocation(uiLocation.lineNumber, uiLocation.columnNumber || 0);
|
|
108
|
-
this
|
|
109
|
-
this
|
|
109
|
+
this.#uiSourceCode = uiLocation.uiSourceCode;
|
|
110
|
+
this.#uiSourceCode.addMessage(this);
|
|
110
111
|
}
|
|
111
112
|
|
|
112
113
|
getIssueKind(): IssueKind {
|
|
113
|
-
return this
|
|
114
|
+
return this.#kind;
|
|
114
115
|
}
|
|
115
116
|
|
|
116
117
|
dispose(): void {
|
|
117
|
-
if (this
|
|
118
|
-
this
|
|
118
|
+
if (this.#uiSourceCode) {
|
|
119
|
+
this.#uiSourceCode.removeMessage(this);
|
|
119
120
|
}
|
|
120
121
|
}
|
|
121
122
|
}
|
|
@@ -20,21 +20,21 @@ const str_ = i18n.i18n.registerUIStrings('models/issues_manager/TrustedWebActivi
|
|
|
20
20
|
const i18nLazyString = i18n.i18n.getLazilyComputedLocalizedString.bind(undefined, str_);
|
|
21
21
|
|
|
22
22
|
export class TrustedWebActivityIssue extends Issue {
|
|
23
|
-
|
|
23
|
+
#issueDetails: Protocol.Audits.TrustedWebActivityIssueDetails;
|
|
24
24
|
|
|
25
25
|
constructor(issueDetails: Protocol.Audits.TrustedWebActivityIssueDetails) {
|
|
26
26
|
const issueCode =
|
|
27
27
|
[Protocol.Audits.InspectorIssueCode.TrustedWebActivityIssue, issueDetails.violationType].join('::');
|
|
28
28
|
super(issueCode);
|
|
29
|
-
this
|
|
29
|
+
this.#issueDetails = issueDetails;
|
|
30
30
|
}
|
|
31
31
|
|
|
32
32
|
details(): Protocol.Audits.TrustedWebActivityIssueDetails {
|
|
33
|
-
return this
|
|
33
|
+
return this.#issueDetails;
|
|
34
34
|
}
|
|
35
35
|
|
|
36
36
|
getDescription(): MarkdownIssueDescription|null {
|
|
37
|
-
const description = issueDescriptions.get(this
|
|
37
|
+
const description = issueDescriptions.get(this.#issueDetails.violationType);
|
|
38
38
|
if (!description) {
|
|
39
39
|
return null;
|
|
40
40
|
}
|
|
@@ -46,7 +46,7 @@ export class TrustedWebActivityIssue extends Issue {
|
|
|
46
46
|
}
|
|
47
47
|
|
|
48
48
|
primaryKey(): string {
|
|
49
|
-
return `${Protocol.Audits.InspectorIssueCode.TrustedWebActivityIssue}-${JSON.stringify(this
|
|
49
|
+
return `${Protocol.Audits.InspectorIssueCode.TrustedWebActivityIssue}-${JSON.stringify(this.#issueDetails)}`;
|
|
50
50
|
}
|
|
51
51
|
|
|
52
52
|
getKind(): IssueKind {
|
|
@@ -20,13 +20,13 @@ const i18nString = i18n.i18n.getLocalizedString.bind(undefined, str_);
|
|
|
20
20
|
|
|
21
21
|
export class WasmCrossOriginModuleSharingIssue extends
|
|
22
22
|
Issue<Protocol.Audits.InspectorIssueCode.WasmCrossOriginModuleSharingIssue> {
|
|
23
|
-
|
|
23
|
+
#issueDetails: Protocol.Audits.WasmCrossOriginModuleSharingIssueDetails;
|
|
24
24
|
|
|
25
25
|
constructor(
|
|
26
26
|
issueDetails: Protocol.Audits.WasmCrossOriginModuleSharingIssueDetails,
|
|
27
27
|
issuesModel: SDK.IssuesModel.IssuesModel) {
|
|
28
28
|
super(Protocol.Audits.InspectorIssueCode.WasmCrossOriginModuleSharingIssue, issuesModel);
|
|
29
|
-
this
|
|
29
|
+
this.#issueDetails = issueDetails;
|
|
30
30
|
}
|
|
31
31
|
|
|
32
32
|
getCategory(): IssueCategory {
|
|
@@ -34,7 +34,7 @@ export class WasmCrossOriginModuleSharingIssue extends
|
|
|
34
34
|
}
|
|
35
35
|
|
|
36
36
|
details(): Protocol.Audits.WasmCrossOriginModuleSharingIssueDetails {
|
|
37
|
-
return this
|
|
37
|
+
return this.#issueDetails;
|
|
38
38
|
}
|
|
39
39
|
|
|
40
40
|
getDescription(): MarkdownIssueDescription|null {
|
|
@@ -48,11 +48,11 @@ export class WasmCrossOriginModuleSharingIssue extends
|
|
|
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 {
|
|
55
|
-
return this
|
|
55
|
+
return this.#issueDetails.isWarning ? IssueKind.BreakingChange : IssueKind.PageError;
|
|
56
56
|
}
|
|
57
57
|
|
|
58
58
|
static fromInspectorIssue(issuesModel: SDK.IssuesModel.IssuesModel, inspectorIssue: Protocol.Audits.InspectorIssue):
|
|
@@ -107,30 +107,30 @@ const enum ScreenStatusType {
|
|
|
107
107
|
}
|
|
108
108
|
|
|
109
109
|
export class BackForwardCacheViewWrapper extends UI.ThrottledWidget.ThrottledWidget {
|
|
110
|
-
|
|
110
|
+
readonly #bfcacheView = new BackForwardCacheView();
|
|
111
111
|
|
|
112
112
|
constructor() {
|
|
113
113
|
super(true, 1000);
|
|
114
|
-
this
|
|
114
|
+
this.#getMainResourceTreeModel()?.addEventListener(
|
|
115
115
|
SDK.ResourceTreeModel.Events.MainFrameNavigated, this.update, this);
|
|
116
|
-
this
|
|
116
|
+
this.#getMainResourceTreeModel()?.addEventListener(
|
|
117
117
|
SDK.ResourceTreeModel.Events.BackForwardCacheDetailsUpdated, this.update, this);
|
|
118
118
|
this.contentElement.classList.add('overflow-auto');
|
|
119
|
-
this.contentElement.appendChild(this
|
|
119
|
+
this.contentElement.appendChild(this.#bfcacheView);
|
|
120
120
|
this.update();
|
|
121
121
|
}
|
|
122
122
|
|
|
123
123
|
async doUpdate(): Promise<void> {
|
|
124
|
-
this
|
|
124
|
+
this.#bfcacheView.data = {frame: this.#getMainFrame()};
|
|
125
125
|
}
|
|
126
126
|
|
|
127
|
-
|
|
127
|
+
#getMainResourceTreeModel(): SDK.ResourceTreeModel.ResourceTreeModel|null {
|
|
128
128
|
const mainTarget = SDK.TargetManager.TargetManager.instance().mainTarget();
|
|
129
129
|
return mainTarget?.model(SDK.ResourceTreeModel.ResourceTreeModel) || null;
|
|
130
130
|
}
|
|
131
131
|
|
|
132
|
-
|
|
133
|
-
return this
|
|
132
|
+
#getMainFrame(): SDK.ResourceTreeModel.ResourceTreeFrame|null {
|
|
133
|
+
return this.#getMainResourceTreeModel()?.mainFrame || null;
|
|
134
134
|
}
|
|
135
135
|
}
|
|
136
136
|
|
|
@@ -152,10 +152,10 @@ export class BackForwardCacheView extends HTMLElement {
|
|
|
152
152
|
|
|
153
153
|
set data(data: BackForwardCacheViewData) {
|
|
154
154
|
this.#frame = data.frame;
|
|
155
|
-
this
|
|
155
|
+
this.#render();
|
|
156
156
|
}
|
|
157
157
|
|
|
158
|
-
|
|
158
|
+
async #render(): Promise<void> {
|
|
159
159
|
await coordinator.write('BackForwardCacheView render', () => {
|
|
160
160
|
// Disabled until https://crbug.com/1079231 is fixed.
|
|
161
161
|
// clang-format off
|
|
@@ -163,27 +163,27 @@ export class BackForwardCacheView extends HTMLElement {
|
|
|
163
163
|
<${ReportView.ReportView.Report.litTagName} .data=${
|
|
164
164
|
{reportTitle: i18nString(UIStrings.backForwardCacheTitle)} as ReportView.ReportView.ReportData
|
|
165
165
|
}>
|
|
166
|
-
${this
|
|
166
|
+
${this.#renderMainFrameInformation()}
|
|
167
167
|
</${ReportView.ReportView.Report.litTagName}>
|
|
168
168
|
`, this.#shadow, {host: this});
|
|
169
169
|
// clang-format on
|
|
170
170
|
});
|
|
171
171
|
}
|
|
172
172
|
|
|
173
|
-
|
|
173
|
+
#renderBackForwardCacheTestResult(): void {
|
|
174
174
|
SDK.TargetManager.TargetManager.instance().removeModelListener(
|
|
175
175
|
SDK.ResourceTreeModel.ResourceTreeModel, SDK.ResourceTreeModel.Events.FrameNavigated,
|
|
176
|
-
this
|
|
176
|
+
this.#renderBackForwardCacheTestResult, this);
|
|
177
177
|
this.#screenStatus = ScreenStatusType.Result;
|
|
178
|
-
this
|
|
178
|
+
this.#render();
|
|
179
179
|
}
|
|
180
180
|
|
|
181
|
-
|
|
181
|
+
async #goBackOneHistoryEntry(): Promise<void> {
|
|
182
182
|
SDK.TargetManager.TargetManager.instance().removeModelListener(
|
|
183
183
|
SDK.ResourceTreeModel.ResourceTreeModel, SDK.ResourceTreeModel.Events.FrameNavigated,
|
|
184
|
-
this
|
|
184
|
+
this.#goBackOneHistoryEntry, this);
|
|
185
185
|
this.#screenStatus = ScreenStatusType.Running;
|
|
186
|
-
this
|
|
186
|
+
this.#render();
|
|
187
187
|
const mainTarget = SDK.TargetManager.TargetManager.instance().mainTarget();
|
|
188
188
|
if (!mainTarget) {
|
|
189
189
|
return;
|
|
@@ -198,11 +198,11 @@ export class BackForwardCacheView extends HTMLElement {
|
|
|
198
198
|
}
|
|
199
199
|
SDK.TargetManager.TargetManager.instance().addModelListener(
|
|
200
200
|
SDK.ResourceTreeModel.ResourceTreeModel, SDK.ResourceTreeModel.Events.FrameNavigated,
|
|
201
|
-
this
|
|
201
|
+
this.#renderBackForwardCacheTestResult, this);
|
|
202
202
|
resourceTreeModel.navigateToHistoryEntry(historyResults.entries[historyResults.currentIndex - 1]);
|
|
203
203
|
}
|
|
204
204
|
|
|
205
|
-
|
|
205
|
+
async #navigateAwayAndBack(): Promise<void> {
|
|
206
206
|
// Checking BFCache Compatibility
|
|
207
207
|
|
|
208
208
|
const mainTarget = SDK.TargetManager.TargetManager.instance().mainTarget();
|
|
@@ -215,7 +215,7 @@ export class BackForwardCacheView extends HTMLElement {
|
|
|
215
215
|
// This event is removed by inside of goBackOneHistoryEntry().
|
|
216
216
|
SDK.TargetManager.TargetManager.instance().addModelListener(
|
|
217
217
|
SDK.ResourceTreeModel.ResourceTreeModel, SDK.ResourceTreeModel.Events.FrameNavigated,
|
|
218
|
-
this
|
|
218
|
+
this.#goBackOneHistoryEntry, this);
|
|
219
219
|
|
|
220
220
|
// We can know whether the current page can use BFCache
|
|
221
221
|
// as the browser navigates to another unrelated page and goes back to the current page.
|
|
@@ -225,7 +225,7 @@ export class BackForwardCacheView extends HTMLElement {
|
|
|
225
225
|
}
|
|
226
226
|
}
|
|
227
227
|
|
|
228
|
-
|
|
228
|
+
#renderMainFrameInformation(): LitHtml.TemplateResult {
|
|
229
229
|
if (!this.#frame) {
|
|
230
230
|
// clang-format off
|
|
231
231
|
return LitHtml.html`
|
|
@@ -241,7 +241,7 @@ export class BackForwardCacheView extends HTMLElement {
|
|
|
241
241
|
const isDisabled = this.#screenStatus === ScreenStatusType.Running;
|
|
242
242
|
// clang-format off
|
|
243
243
|
return LitHtml.html`
|
|
244
|
-
${this
|
|
244
|
+
${this.#renderBackForwardCacheStatus(this.#frame.backForwardCacheDetails.restoredFromCache)}
|
|
245
245
|
<div class='url'>
|
|
246
246
|
<div class='url-key'>
|
|
247
247
|
${i18nString(UIStrings.url)}
|
|
@@ -255,7 +255,7 @@ export class BackForwardCacheView extends HTMLElement {
|
|
|
255
255
|
.disabled=${isDisabled}
|
|
256
256
|
.spinner=${isDisabled}
|
|
257
257
|
.variant=${Buttons.Button.Variant.PRIMARY}
|
|
258
|
-
@click=${this
|
|
258
|
+
@click=${this.#navigateAwayAndBack}>
|
|
259
259
|
${isDisabled ? LitHtml.html`
|
|
260
260
|
${i18nString(UIStrings.runningTest)}`:`
|
|
261
261
|
${i18nString(UIStrings.runTest)}
|
|
@@ -264,7 +264,7 @@ export class BackForwardCacheView extends HTMLElement {
|
|
|
264
264
|
</${ReportView.ReportView.ReportSection.litTagName}>
|
|
265
265
|
<${ReportView.ReportView.ReportSectionDivider.litTagName}>
|
|
266
266
|
</${ReportView.ReportView.ReportSectionDivider.litTagName}>
|
|
267
|
-
${this
|
|
267
|
+
${this.#maybeRenderExplanations(this.#frame.backForwardCacheDetails.explanations)}
|
|
268
268
|
<${ReportView.ReportView.ReportSection.litTagName}>
|
|
269
269
|
<x-link href="https://web.dev/bfcache/" class="link">
|
|
270
270
|
${i18nString(UIStrings.learnMore)}
|
|
@@ -274,7 +274,7 @@ export class BackForwardCacheView extends HTMLElement {
|
|
|
274
274
|
// clang-format on
|
|
275
275
|
}
|
|
276
276
|
|
|
277
|
-
|
|
277
|
+
#renderBackForwardCacheStatus(status: boolean|undefined): LitHtml.TemplateResult {
|
|
278
278
|
switch (status) {
|
|
279
279
|
case true:
|
|
280
280
|
// clang-format off
|
|
@@ -320,8 +320,8 @@ export class BackForwardCacheView extends HTMLElement {
|
|
|
320
320
|
// clang-format on
|
|
321
321
|
}
|
|
322
322
|
|
|
323
|
-
|
|
324
|
-
|
|
323
|
+
#maybeRenderExplanations(explanations: Protocol.Page.BackForwardCacheNotRestoredExplanation[]): LitHtml.TemplateResult
|
|
324
|
+
|{} {
|
|
325
325
|
if (explanations.length === 0) {
|
|
326
326
|
return LitHtml.nothing;
|
|
327
327
|
}
|
|
@@ -336,14 +336,14 @@ export class BackForwardCacheView extends HTMLElement {
|
|
|
336
336
|
// Disabled until https://crbug.com/1079231 is fixed.
|
|
337
337
|
// clang-format off
|
|
338
338
|
return LitHtml.html`
|
|
339
|
-
${this
|
|
340
|
-
${this
|
|
341
|
-
${this
|
|
339
|
+
${this.#renderExplanations(i18nString(UIStrings.pageSupportNeeded), i18nString(UIStrings.pageSupportNeededExplanation), pageSupportNeeded)}
|
|
340
|
+
${this.#renderExplanations(i18nString(UIStrings.supportPending), i18nString(UIStrings.supportPendingExplanation), supportPending)}
|
|
341
|
+
${this.#renderExplanations(i18nString(UIStrings.circumstantial), i18nString(UIStrings.circumstantialExplanation), circumstantial)}
|
|
342
342
|
`;
|
|
343
343
|
// clang-format on
|
|
344
344
|
}
|
|
345
345
|
|
|
346
|
-
|
|
346
|
+
#renderExplanations(
|
|
347
347
|
category: Platform.UIString.LocalizedString, explainerText: Platform.UIString.LocalizedString,
|
|
348
348
|
explanations: Protocol.Page.BackForwardCacheNotRestoredExplanation[]): LitHtml.TemplateResult {
|
|
349
349
|
// Disabled until https://crbug.com/1079231 is fixed.
|
|
@@ -362,13 +362,13 @@ export class BackForwardCacheView extends HTMLElement {
|
|
|
362
362
|
</${IconButton.Icon.Icon.litTagName}>
|
|
363
363
|
</div>
|
|
364
364
|
</${ReportView.ReportView.ReportSectionHeader.litTagName}>
|
|
365
|
-
${explanations.map(explanation => this
|
|
365
|
+
${explanations.map(explanation => this.#renderReason(explanation))}
|
|
366
366
|
` : LitHtml.nothing}
|
|
367
367
|
`;
|
|
368
368
|
// clang-format on
|
|
369
369
|
}
|
|
370
370
|
|
|
371
|
-
|
|
371
|
+
#renderReason(explanation: Protocol.Page.BackForwardCacheNotRestoredExplanation): LitHtml.TemplateResult {
|
|
372
372
|
// clang-format off
|
|
373
373
|
return LitHtml.html`
|
|
374
374
|
<${ReportView.ReportView.ReportSection.litTagName}>
|
|
@@ -30,20 +30,20 @@ export interface EndpointsGridData {
|
|
|
30
30
|
export class EndpointsGrid extends HTMLElement {
|
|
31
31
|
static readonly litTagName = LitHtml.literal`devtools-resources-endpoints-grid`;
|
|
32
32
|
|
|
33
|
-
|
|
34
|
-
|
|
33
|
+
readonly #shadow = this.attachShadow({mode: 'open'});
|
|
34
|
+
#endpoints: Map<string, Protocol.Network.ReportingApiEndpoint[]> = new Map();
|
|
35
35
|
|
|
36
36
|
connectedCallback(): void {
|
|
37
|
-
this
|
|
38
|
-
this
|
|
37
|
+
this.#shadow.adoptedStyleSheets = [reportingApiGridStyles];
|
|
38
|
+
this.#render();
|
|
39
39
|
}
|
|
40
40
|
|
|
41
41
|
set data(data: EndpointsGridData) {
|
|
42
|
-
this
|
|
43
|
-
this
|
|
42
|
+
this.#endpoints = data.endpoints;
|
|
43
|
+
this.#render();
|
|
44
44
|
}
|
|
45
45
|
|
|
46
|
-
|
|
46
|
+
#render(): void {
|
|
47
47
|
const endpointsGridData: DataGrid.DataGridController.DataGridControllerData = {
|
|
48
48
|
columns: [
|
|
49
49
|
{
|
|
@@ -68,7 +68,7 @@ export class EndpointsGrid extends HTMLElement {
|
|
|
68
68
|
visible: true,
|
|
69
69
|
},
|
|
70
70
|
],
|
|
71
|
-
rows: this
|
|
71
|
+
rows: this.#buildReportRows(),
|
|
72
72
|
};
|
|
73
73
|
|
|
74
74
|
// Disabled until https://crbug.com/1079231 is fixed.
|
|
@@ -76,7 +76,7 @@ export class EndpointsGrid extends HTMLElement {
|
|
|
76
76
|
render(html`
|
|
77
77
|
<div class="reporting-container">
|
|
78
78
|
<div class="reporting-header">${i18n.i18n.lockedString('Endpoints')}</div>
|
|
79
|
-
${this
|
|
79
|
+
${this.#endpoints.size > 0 ? html`
|
|
80
80
|
<${DataGrid.DataGridController.DataGridController.litTagName} .data=${
|
|
81
81
|
endpointsGridData as DataGrid.DataGridController.DataGridControllerData}>
|
|
82
82
|
</${DataGrid.DataGridController.DataGridController.litTagName}>
|
|
@@ -86,12 +86,12 @@ export class EndpointsGrid extends HTMLElement {
|
|
|
86
86
|
</div>
|
|
87
87
|
`}
|
|
88
88
|
</div>
|
|
89
|
-
`, this
|
|
89
|
+
`, this.#shadow);
|
|
90
90
|
// clang-format on
|
|
91
91
|
}
|
|
92
92
|
|
|
93
|
-
|
|
94
|
-
return Array.from(this
|
|
93
|
+
#buildReportRows(): DataGrid.DataGridUtils.Row[] {
|
|
94
|
+
return Array.from(this.#endpoints)
|
|
95
95
|
.map(([origin, endpointArray]) => endpointArray.map(endpoint => {
|
|
96
96
|
return {
|
|
97
97
|
cells: [
|