chrome-devtools-frontend 1.0.1660788 → 1.0.1661063

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.
Files changed (132) hide show
  1. package/.agents/skills/evaluate-ai-css-completion/SKILL.md +133 -0
  2. package/.agents/skills/evaluate-ai-css-completion/scripts/evaluate.js +76 -0
  3. package/eslint.config.mjs +7 -0
  4. package/extension-api/ExtensionAPI.d.ts +88 -0
  5. package/front_end/core/host/InspectorFrontendHost.ts +1 -0
  6. package/front_end/core/host/InspectorFrontendHostStub.ts +2 -0
  7. package/front_end/core/platform/StringUtilities.ts +20 -4
  8. package/front_end/core/sdk/CPUThrottlingManager.ts +2 -0
  9. package/front_end/core/sdk/DOMDebuggerModel.ts +2 -0
  10. package/front_end/core/sdk/DOMModel.ts +1 -0
  11. package/front_end/core/sdk/DebuggerModel.ts +4 -4
  12. package/front_end/core/sdk/EventBreakpointsModel.ts +2 -0
  13. package/front_end/core/sdk/FrameManager.ts +1 -0
  14. package/front_end/core/sdk/IsolateManager.ts +1 -0
  15. package/front_end/core/sdk/NetworkManager.ts +2 -0
  16. package/front_end/core/sdk/NetworkRequest.ts +1 -0
  17. package/front_end/core/sdk/PageResourceLoader.ts +2 -0
  18. package/front_end/core/sdk/SourceMap.ts +5 -5
  19. package/front_end/core/sdk/SourceMapManager.ts +3 -2
  20. package/front_end/core/sdk/TargetManager.ts +4 -0
  21. package/front_end/entrypoints/main/MainImpl.ts +2 -1
  22. package/front_end/models/bindings/CompilerScriptMapping.ts +5 -6
  23. package/front_end/models/bindings/ContentProviderBasedProject.ts +4 -4
  24. package/front_end/models/bindings/DebuggerLanguagePlugins.ts +3 -4
  25. package/front_end/models/bindings/DefaultScriptMapping.ts +3 -3
  26. package/front_end/models/bindings/NetworkProject.ts +1 -10
  27. package/front_end/models/bindings/ResourceMapping.ts +3 -4
  28. package/front_end/models/bindings/ResourceScriptMapping.ts +2 -3
  29. package/front_end/models/bindings/SASSSourceMapping.ts +3 -4
  30. package/front_end/models/bindings/StylesSourceMapping.ts +3 -3
  31. package/front_end/models/bindings/TempFile.ts +8 -3
  32. package/front_end/models/extensions/ExtensionAPI.ts +110 -46
  33. package/front_end/models/formatter/ScriptFormatter.ts +8 -11
  34. package/front_end/models/issues_manager/CookieIssue.ts +21 -9
  35. package/front_end/models/issues_manager/Issue.ts +3 -4
  36. package/front_end/models/issues_manager/IssueAggregator.ts +0 -9
  37. package/front_end/models/issues_manager/IssueResolver.ts +2 -2
  38. package/front_end/models/issues_manager/IssuesManager.ts +136 -137
  39. package/front_end/models/issues_manager/issues_manager.ts +0 -2
  40. package/front_end/models/persistence/AutomaticFileSystemWorkspaceBinding.ts +5 -0
  41. package/front_end/models/source_map_scopes/FunctionCodeResolver.ts +13 -10
  42. package/front_end/models/workspace/WorkspaceImpl.ts +10 -1
  43. package/front_end/models/workspace_diff/WorkspaceDiff.ts +10 -4
  44. package/front_end/panels/ai_assistance/components/ChatMessage.ts +2 -1
  45. package/front_end/panels/application/FrameDetailsView.ts +1 -1
  46. package/front_end/panels/application/WebMCPView.ts +38 -43
  47. package/front_end/panels/application/components/AdsView.ts +201 -30
  48. package/front_end/panels/application/components/adsView.css +25 -0
  49. package/front_end/panels/application/preloading/components/RuleSetDetailsView.ts +2 -2
  50. package/front_end/panels/console/ConsoleView.ts +2 -1
  51. package/front_end/panels/console/PromptBuilder.ts +2 -1
  52. package/front_end/panels/emulation/DeviceModeView.ts +52 -70
  53. package/front_end/panels/issues/IssueView.ts +0 -2
  54. package/front_end/panels/issues/IssuesPane.ts +1 -8
  55. package/front_end/panels/js_timeline/js_timeline-meta.ts +3 -2
  56. package/front_end/panels/linear_memory_inspector/LinearMemoryInspectorController.ts +3 -3
  57. package/front_end/panels/linear_memory_inspector/LinearMemoryInspectorPane.ts +5 -5
  58. package/front_end/panels/linear_memory_inspector/components/LinearMemoryHighlightChipList.ts +4 -4
  59. package/front_end/panels/linear_memory_inspector/components/LinearMemoryInspector.ts +2 -2
  60. package/front_end/panels/linear_memory_inspector/components/LinearMemoryNavigator.ts +6 -6
  61. package/front_end/panels/linear_memory_inspector/components/LinearMemoryValueInterpreter.ts +3 -3
  62. package/front_end/panels/linear_memory_inspector/components/ValueInterpreterDisplay.ts +8 -9
  63. package/front_end/panels/linear_memory_inspector/components/ValueInterpreterDisplayUtils.ts +2 -2
  64. package/front_end/panels/linear_memory_inspector/components/ValueInterpreterSettings.ts +1 -1
  65. package/front_end/panels/linear_memory_inspector/linear_memory_inspector-meta.ts +2 -2
  66. package/front_end/panels/network/RequestPayloadView.ts +15 -13
  67. package/front_end/panels/network/RequestTimingView.ts +95 -127
  68. package/front_end/panels/profiler/HeapSnapshotView.ts +1 -1
  69. package/front_end/panels/profiler/WritableProfileHeader.ts +2 -2
  70. package/front_end/panels/recorder/{components/ControlButton.ts → ControlButton.ts} +9 -10
  71. package/front_end/panels/recorder/{components/CreateRecordingView.ts → CreateRecordingView.ts} +48 -47
  72. package/front_end/panels/recorder/{components/ExtensionView.ts → ExtensionView.ts} +8 -8
  73. package/front_end/panels/recorder/RecorderController.ts +88 -77
  74. package/front_end/panels/recorder/{components/RecordingListView.ts → RecordingListView.ts} +19 -20
  75. package/front_end/panels/recorder/{components/RecordingView.ts → RecordingView.ts} +88 -88
  76. package/front_end/panels/recorder/{components/ReplaySection.ts → ReplaySection.ts} +11 -11
  77. package/front_end/panels/recorder/{components/SelectorPicker.ts → SelectorPicker.ts} +13 -13
  78. package/front_end/panels/recorder/{components/StepEditor.ts → StepEditor.ts} +15 -15
  79. package/front_end/panels/recorder/{components/StepView.ts → StepView.ts} +10 -10
  80. package/front_end/panels/recorder/{components/TimelineSection.ts → TimelineSection.ts} +2 -2
  81. package/front_end/panels/recorder/recorder.ts +23 -1
  82. package/front_end/panels/recorder/util/util.ts +113 -0
  83. package/front_end/panels/sources/InplaceFormatterEditorAction.ts +2 -2
  84. package/front_end/panels/sources/SourcesNavigator.ts +2 -3
  85. package/front_end/panels/sources/TabbedEditorContainer.ts +1 -1
  86. package/front_end/panels/timeline/IsolateSelector.ts +10 -8
  87. package/front_end/panels/timeline/TimelinePanel.ts +18 -7
  88. package/front_end/panels/timeline/TimelineUIUtils.ts +144 -129
  89. package/front_end/panels/timeline/timeline-meta.ts +3 -2
  90. package/front_end/third_party/chromium/README.chromium +1 -1
  91. package/front_end/ui/legacy/Treeoutline.ts +3 -0
  92. package/front_end/ui/legacy/Widget.ts +14 -15
  93. package/front_end/ui/legacy/components/object_ui/ObjectPropertiesSection.ts +11 -7
  94. package/front_end/ui/legacy/components/source_frame/SourceFrame.ts +2 -1
  95. package/front_end/ui/legacy/components/utils/JSPresentationUtils.ts +10 -1
  96. package/package.json +1 -1
  97. package/front_end/models/issues_manager/AttributionReportingIssue.ts +0 -247
  98. package/front_end/models/issues_manager/descriptions/arInsecureContext.md +0 -7
  99. package/front_end/models/issues_manager/descriptions/arInvalidInfoHeader.md +0 -5
  100. package/front_end/models/issues_manager/descriptions/arInvalidRegisterOsSourceHeader.md +0 -5
  101. package/front_end/models/issues_manager/descriptions/arInvalidRegisterOsTriggerHeader.md +0 -5
  102. package/front_end/models/issues_manager/descriptions/arInvalidRegisterSourceHeader.md +0 -5
  103. package/front_end/models/issues_manager/descriptions/arInvalidRegisterTriggerHeader.md +0 -5
  104. package/front_end/models/issues_manager/descriptions/arNavigationRegistrationUniqueScopeAlreadySet.md +0 -5
  105. package/front_end/models/issues_manager/descriptions/arNavigationRegistrationWithoutTransientUserActivation.md +0 -6
  106. package/front_end/models/issues_manager/descriptions/arNoRegisterOsSourceHeader.md +0 -5
  107. package/front_end/models/issues_manager/descriptions/arNoRegisterOsTriggerHeader.md +0 -5
  108. package/front_end/models/issues_manager/descriptions/arNoRegisterSourceHeader.md +0 -5
  109. package/front_end/models/issues_manager/descriptions/arNoRegisterTriggerHeader.md +0 -5
  110. package/front_end/models/issues_manager/descriptions/arNoWebOrOsSupport.md +0 -4
  111. package/front_end/models/issues_manager/descriptions/arOsSourceIgnored.md +0 -18
  112. package/front_end/models/issues_manager/descriptions/arOsTriggerIgnored.md +0 -19
  113. package/front_end/models/issues_manager/descriptions/arPermissionPolicyDisabled.md +0 -8
  114. package/front_end/models/issues_manager/descriptions/arSourceAndTriggerHeaders.md +0 -9
  115. package/front_end/models/issues_manager/descriptions/arSourceIgnored.md +0 -13
  116. package/front_end/models/issues_manager/descriptions/arTriggerIgnored.md +0 -12
  117. package/front_end/models/issues_manager/descriptions/arUntrustworthyReportingOrigin.md +0 -10
  118. package/front_end/models/issues_manager/descriptions/arWebAndOsHeaders.md +0 -11
  119. package/front_end/panels/issues/AttributionReportingIssueDetailsView.ts +0 -182
  120. package/front_end/panels/recorder/components/components.ts +0 -25
  121. package/front_end/panels/recorder/components/util.ts +0 -116
  122. /package/front_end/panels/recorder/{components/controlButton.css → controlButton.css} +0 -0
  123. /package/front_end/panels/recorder/{components/createRecordingView.css → createRecordingView.css} +0 -0
  124. /package/front_end/panels/recorder/{components/extensionView.css → extensionView.css} +0 -0
  125. /package/front_end/panels/recorder/{components/recordingListView.css → recordingListView.css} +0 -0
  126. /package/front_end/panels/recorder/{components/recordingView.css → recordingView.css} +0 -0
  127. /package/front_end/panels/recorder/{components/replaySection.css → replaySection.css} +0 -0
  128. /package/front_end/panels/recorder/{components/selectorPicker.css → selectorPicker.css} +0 -0
  129. /package/front_end/panels/recorder/{components/startView.css → startView.css} +0 -0
  130. /package/front_end/panels/recorder/{components/stepEditor.css → stepEditor.css} +0 -0
  131. /package/front_end/panels/recorder/{components/stepView.css → stepView.css} +0 -0
  132. /package/front_end/panels/recorder/{components/timelineSection.css → timelineSection.css} +0 -0
@@ -1,13 +0,0 @@
1
- # An attribution source registration was ignored because the request was ineligible
2
-
3
- This page tried to register a source using the Attribution Reporting API, but
4
- the request was ineligible to do so, so the source registration was ignored.
5
-
6
- A request is eligible for source registration if it has an
7
- `Attribution-Reporting-Eligible` header whose value is a structured dictionary
8
- that contains the key `navigation-source` or `event-source`. If the header is
9
- absent or does not contain one of those keys, any
10
- `Attribution-Reporting-Register-Source` response header will be ignored.
11
-
12
- Additionally, a single HTTP redirect chain may register only all sources or all
13
- triggers, not a combination of both.
@@ -1,12 +0,0 @@
1
- # An attribution trigger registration was ignored because the request was ineligible
2
-
3
- This page tried to register a trigger using the Attribution Reporting API, but
4
- the request was ineligible to do so, so the trigger registration was ignored.
5
-
6
- A request is eligible for trigger registration if it has an
7
- `Attribution-Reporting-Eligible` header whose value is a structured dictionary
8
- that contains the key `trigger`, or if the header is absent. Otherwise, any
9
- `Attribution-Reporting-Register-Trigger` response header will be ignored.
10
-
11
- Additionally, a single HTTP redirect chain may register only all sources or all
12
- triggers, not a combination of both.
@@ -1,10 +0,0 @@
1
- # Ensure that attribution reporting origins are trustworthy
2
-
3
- This page tried to register a source or trigger using the Attribution Reporting
4
- API but failed because the reporting origin was not potentially trustworthy.
5
-
6
- The reporting origin is typically the server that sets the
7
- `Attribution-Reporting-Register-Source` or
8
- `Attribution-Reporting-Register-Trigger` header.
9
-
10
- The reporting origin must use HTTPS unless it is `localhost` or `127.0.0.1`.
@@ -1,11 +0,0 @@
1
- # Ensure that attribution responses contain either web or OS headers, not both
2
-
3
- This page included web and OS Attribution Reporting API headers in the same
4
- HTTP response, which is prohibited.
5
-
6
- The response may set at most one of the following headers:
7
-
8
- - `Attribution-Reporting-Register-OS-Source`
9
- - `Attribution-Reporting-Register-OS-Trigger`
10
- - `Attribution-Reporting-Register-Source`
11
- - `Attribution-Reporting-Register-Trigger`
@@ -1,182 +0,0 @@
1
- // Copyright 2021 The Chromium Authors
2
- // Use of this source code is governed by a BSD-style license that can be
3
- // found in the LICENSE file.
4
- /* eslint-disable @devtools/no-imperative-dom-api */
5
-
6
- import * as Host from '../../core/host/host.js';
7
- import * as i18n from '../../core/i18n/i18n.js';
8
- import type * as Protocol from '../../generated/protocol.js';
9
- import * as IssuesManager from '../../models/issues_manager/issues_manager.js';
10
-
11
- import {AffectedItem, AffectedResourcesView} from './AffectedResourcesView.js';
12
-
13
- const UIStrings = {
14
- /**
15
- * @description Label for number of rows in the issue details table.
16
- */
17
- nViolations: '{n, plural, =1 {# violation} other {# violations}}',
18
- /**
19
- * @description Noun, label for the column showing the associated HTML element in the issue details table.
20
- */
21
- element: 'Element',
22
- /**
23
- * @description Noun, label for the column showing the invalid header value in the issue details table.
24
- */
25
- invalidHeaderValue: 'Invalid Header Value',
26
- /**
27
- * @description Noun, label for the column showing the associated network request in the issue details table.
28
- */
29
- request: 'Request',
30
- /**
31
- * @description Label for the column showing the invalid URL used in an HTML anchor element ("a link").
32
- * A origin is (roughly said) the front part of a URL.
33
- */
34
- untrustworthyOrigin: 'Untrustworthy origin',
35
- } as const;
36
- const str_ = i18n.i18n.registerUIStrings('panels/issues/AttributionReportingIssueDetailsView.ts', UIStrings);
37
- const i18nString = i18n.i18n.getLocalizedString.bind(undefined, str_);
38
-
39
- export class AttributionReportingIssueDetailsView extends AffectedResourcesView {
40
- protected override getResourceNameWithCount(count: number): string {
41
- return i18nString(UIStrings.nViolations, {n: count});
42
- }
43
-
44
- override update(): void {
45
- this.clear();
46
- const issues = this.issue.getAttributionReportingIssues();
47
- const issue = issues.values().next();
48
- if (issue.done) {
49
- this.updateAffectedResourceCount(0);
50
- } else {
51
- this.#appendDetails(issue.value.code(), issues);
52
- }
53
- }
54
-
55
- #appendDetails(
56
- issueCode: IssuesManager.AttributionReportingIssue.IssueCode,
57
- issues: Iterable<IssuesManager.AttributionReportingIssue.AttributionReportingIssue>): void {
58
- const header = document.createElement('tr');
59
- switch (issueCode) {
60
- case IssuesManager.AttributionReportingIssue.IssueCode.INVALID_REGISTER_SOURCE_HEADER:
61
- case IssuesManager.AttributionReportingIssue.IssueCode.INVALID_REGISTER_TRIGGER_HEADER:
62
- case IssuesManager.AttributionReportingIssue.IssueCode.INVALID_REGISTER_OS_SOURCE_HEADER:
63
- case IssuesManager.AttributionReportingIssue.IssueCode.INVALID_REGISTER_OS_TRIGGER_HEADER:
64
- case IssuesManager.AttributionReportingIssue.IssueCode.OS_SOURCE_IGNORED:
65
- case IssuesManager.AttributionReportingIssue.IssueCode.OS_TRIGGER_IGNORED:
66
- case IssuesManager.AttributionReportingIssue.IssueCode.SOURCE_IGNORED:
67
- case IssuesManager.AttributionReportingIssue.IssueCode.TRIGGER_IGNORED:
68
- case IssuesManager.AttributionReportingIssue.IssueCode.INVALID_INFO_HEADER:
69
- case IssuesManager.AttributionReportingIssue.IssueCode.NAVIGATION_REGISTRATION_UNIQUE_SCOPE_ALREADY_SET:
70
- this.appendColumnTitle(header, i18nString(UIStrings.request));
71
- this.appendColumnTitle(header, i18nString(UIStrings.invalidHeaderValue));
72
- break;
73
- case IssuesManager.AttributionReportingIssue.IssueCode.INSECURE_CONTEXT:
74
- case IssuesManager.AttributionReportingIssue.IssueCode.UNTRUSTWORTHY_REPORTING_ORIGIN:
75
- this.appendColumnTitle(header, i18nString(UIStrings.element));
76
- this.appendColumnTitle(header, i18nString(UIStrings.request));
77
- this.appendColumnTitle(header, i18nString(UIStrings.untrustworthyOrigin));
78
- break;
79
- case IssuesManager.AttributionReportingIssue.IssueCode.PERMISSION_POLICY_DISABLED:
80
- this.appendColumnTitle(header, i18nString(UIStrings.element));
81
- this.appendColumnTitle(header, i18nString(UIStrings.request));
82
- break;
83
- case IssuesManager.AttributionReportingIssue.IssueCode.SOURCE_AND_TRIGGER_HEADERS:
84
- case IssuesManager.AttributionReportingIssue.IssueCode.WEB_AND_OS_HEADERS:
85
- case IssuesManager.AttributionReportingIssue.IssueCode.NO_WEB_OR_OS_SUPPORT:
86
- case IssuesManager.AttributionReportingIssue.IssueCode.NO_REGISTER_SOURCE_HEADER:
87
- case IssuesManager.AttributionReportingIssue.IssueCode.NO_REGISTER_TRIGGER_HEADER:
88
- case IssuesManager.AttributionReportingIssue.IssueCode.NO_REGISTER_OS_SOURCE_HEADER:
89
- case IssuesManager.AttributionReportingIssue.IssueCode.NO_REGISTER_OS_TRIGGER_HEADER:
90
- this.appendColumnTitle(header, i18nString(UIStrings.request));
91
- break;
92
- case IssuesManager.AttributionReportingIssue.IssueCode.NAVIGATION_REGISTRATION_WITHOUT_TRANSIENT_USER_ACTIVATION:
93
- this.appendColumnTitle(header, i18nString(UIStrings.element));
94
- break;
95
- }
96
-
97
- this.affectedResources.appendChild(header);
98
- let count = 0;
99
- for (const issue of issues) {
100
- count++;
101
- void this.#appendDetail(issueCode, issue);
102
- }
103
- this.updateAffectedResourceCount(count);
104
- }
105
-
106
- async #appendDetail(
107
- issueCode: IssuesManager.AttributionReportingIssue.IssueCode,
108
- issue: IssuesManager.AttributionReportingIssue.AttributionReportingIssue): Promise<void> {
109
- const element = document.createElement('tr');
110
- element.classList.add('affected-resource-directive');
111
-
112
- const details = issue.details();
113
-
114
- switch (issueCode) {
115
- case IssuesManager.AttributionReportingIssue.IssueCode.INVALID_REGISTER_SOURCE_HEADER:
116
- case IssuesManager.AttributionReportingIssue.IssueCode.INVALID_REGISTER_TRIGGER_HEADER:
117
- case IssuesManager.AttributionReportingIssue.IssueCode.INVALID_REGISTER_OS_SOURCE_HEADER:
118
- case IssuesManager.AttributionReportingIssue.IssueCode.INVALID_REGISTER_OS_TRIGGER_HEADER:
119
- case IssuesManager.AttributionReportingIssue.IssueCode.OS_SOURCE_IGNORED:
120
- case IssuesManager.AttributionReportingIssue.IssueCode.OS_TRIGGER_IGNORED:
121
- case IssuesManager.AttributionReportingIssue.IssueCode.SOURCE_IGNORED:
122
- case IssuesManager.AttributionReportingIssue.IssueCode.TRIGGER_IGNORED:
123
- case IssuesManager.AttributionReportingIssue.IssueCode.INVALID_INFO_HEADER:
124
- case IssuesManager.AttributionReportingIssue.IssueCode.NAVIGATION_REGISTRATION_UNIQUE_SCOPE_ALREADY_SET:
125
- this.#appendRequestOrEmptyCell(element, details.request);
126
- this.appendIssueDetailCell(element, details.invalidParameter || '');
127
- break;
128
- case IssuesManager.AttributionReportingIssue.IssueCode.INSECURE_CONTEXT:
129
- case IssuesManager.AttributionReportingIssue.IssueCode.UNTRUSTWORTHY_REPORTING_ORIGIN:
130
- await this.#appendElementOrEmptyCell(element, issue);
131
- this.#appendRequestOrEmptyCell(element, details.request);
132
- this.appendIssueDetailCell(element, details.invalidParameter || '');
133
- break;
134
- case IssuesManager.AttributionReportingIssue.IssueCode.PERMISSION_POLICY_DISABLED:
135
- await this.#appendElementOrEmptyCell(element, issue);
136
- this.#appendRequestOrEmptyCell(element, details.request);
137
- break;
138
- case IssuesManager.AttributionReportingIssue.IssueCode.SOURCE_AND_TRIGGER_HEADERS:
139
- case IssuesManager.AttributionReportingIssue.IssueCode.WEB_AND_OS_HEADERS:
140
- case IssuesManager.AttributionReportingIssue.IssueCode.NO_WEB_OR_OS_SUPPORT:
141
- case IssuesManager.AttributionReportingIssue.IssueCode.NO_REGISTER_SOURCE_HEADER:
142
- case IssuesManager.AttributionReportingIssue.IssueCode.NO_REGISTER_TRIGGER_HEADER:
143
- case IssuesManager.AttributionReportingIssue.IssueCode.NO_REGISTER_OS_SOURCE_HEADER:
144
- case IssuesManager.AttributionReportingIssue.IssueCode.NO_REGISTER_OS_TRIGGER_HEADER:
145
- this.#appendRequestOrEmptyCell(element, details.request);
146
- break;
147
- case IssuesManager.AttributionReportingIssue.IssueCode.NAVIGATION_REGISTRATION_WITHOUT_TRANSIENT_USER_ACTIVATION:
148
- await this.#appendElementOrEmptyCell(element, issue);
149
- break;
150
- }
151
-
152
- this.affectedResources.appendChild(element);
153
- }
154
-
155
- async #appendElementOrEmptyCell(
156
- parent: HTMLElement, issue: IssuesManager.AttributionReportingIssue.AttributionReportingIssue): Promise<void> {
157
- const details = issue.details();
158
- if (details.violatingNodeId !== undefined) {
159
- const target = issue.model()?.target() || null;
160
- parent.appendChild(await this.createElementCell(
161
- {backendNodeId: details.violatingNodeId, target, nodeName: 'Attribution source element'},
162
- issue.getCategory()));
163
- } else {
164
- this.appendIssueDetailCell(parent, '');
165
- }
166
- }
167
-
168
- #appendRequestOrEmptyCell(parent: HTMLElement, request?: Protocol.Audits.AffectedRequest): void {
169
- if (!request) {
170
- this.appendIssueDetailCell(parent, '');
171
- return;
172
- }
173
-
174
- const opts = {
175
- additionalOnClickAction(): void {
176
- Host.userMetrics.issuesPanelResourceOpened(
177
- IssuesManager.Issue.IssueCategory.ATTRIBUTION_REPORTING, AffectedItem.REQUEST);
178
- },
179
- };
180
- parent.appendChild(this.createRequestCell(request, opts));
181
- }
182
- }
@@ -1,25 +0,0 @@
1
- // Copyright 2023 The Chromium Authors
2
- // Use of this source code is governed by a BSD-style license that can be
3
- // found in the LICENSE file.
4
-
5
- import * as ControlButton from './ControlButton.js';
6
- import * as CreateRecordingView from './CreateRecordingView.js';
7
- import * as RecordingListView from './RecordingListView.js';
8
- import * as RecordingView from './RecordingView.js';
9
- import * as ReplaySection from './ReplaySection.js';
10
- import * as SelectorPicker from './SelectorPicker.js';
11
- import * as StepEditor from './StepEditor.js';
12
- import * as StepView from './StepView.js';
13
- import * as TimelineSection from './TimelineSection.js';
14
-
15
- export {
16
- ControlButton,
17
- CreateRecordingView,
18
- RecordingListView,
19
- RecordingView,
20
- ReplaySection,
21
- SelectorPicker,
22
- StepEditor,
23
- StepView,
24
- TimelineSection,
25
- };
@@ -1,116 +0,0 @@
1
- // Copyright 2023 The Chromium Authors
2
- // Use of this source code is governed by a BSD-style license that can be
3
- // found in the LICENSE file.
4
-
5
- export const mod = (a: number, n: number): number => {
6
- return ((a % n) + n) % n;
7
- };
8
-
9
- export function assert<T>(
10
- predicate: T,
11
- message = 'Assertion failed!',
12
- ): asserts predicate {
13
- if (!predicate) {
14
- throw new Error(message);
15
- }
16
- }
17
-
18
- export type Keys<T> = T extends T ? keyof T : never;
19
-
20
- export type RequiredKeys<T> = {
21
- [K in keyof T] -?: Record<string|number|symbol, unknown> extends Pick<T, K>? never : K;
22
- }[keyof T];
23
-
24
- export type OptionalKeys<T> = {
25
- [K in keyof T] -?: Record<string|number|symbol, unknown> extends Pick<T, K>? K : never;
26
- }[keyof T];
27
-
28
- export type DeepImmutable<T> = {
29
- readonly[K in keyof T]: DeepImmutable<T[K]>;
30
- };
31
-
32
- export type DeepMutable<T> = {
33
- -readonly[K in keyof T]: DeepMutable<T[K]>;
34
- };
35
-
36
- export type DeepPartial<T> = {
37
- [K in keyof T]?: DeepPartial<Exclude<T[K], undefined>>;
38
- };
39
-
40
- export type Mutable<T> = {
41
- -readonly[K in keyof T]: T[K];
42
- };
43
-
44
- export const deepFreeze = <T extends object>(object: T): DeepImmutable<T> => {
45
- for (const name of Reflect.ownKeys(object)) {
46
- const value = object[name as keyof T];
47
- if ((value && typeof value === 'object') || typeof value === 'function') {
48
- deepFreeze(value);
49
- }
50
- }
51
- return Object.freeze(object);
52
- };
53
-
54
- export class InsertAssignment<T> {
55
- value: T;
56
- constructor(value: T) {
57
- this.value = value;
58
- }
59
- }
60
-
61
- export class ArrayAssignments<T> {
62
- value: Record<number, T>;
63
- constructor(value: Record<number, T>) {
64
- this.value = value;
65
- }
66
- }
67
-
68
- export type Assignments<T> = T extends Readonly<Array<infer R>>?
69
- R[]|ArrayAssignments<Assignments<R>|InsertAssignment<R>>:
70
- {[K in keyof T]: Assignments<T[K]>};
71
-
72
- export const immutableDeepAssign = <T>(
73
- object: DeepImmutable<T>,
74
- assignments: DeepImmutable<DeepPartial<Assignments<T>>>,
75
- ): DeepImmutable<T> => {
76
- if (assignments instanceof ArrayAssignments) {
77
- assert(Array.isArray(object), `Expected an array. Got ${typeof object}.`);
78
- const updatedObject = [...object] as Mutable<typeof object>;
79
- const keys = Object.keys(assignments.value)
80
- .sort(
81
- (a, b) => Number(b) - Number(a),
82
- ) as Array<keyof typeof updatedObject>;
83
- for (const key of keys) {
84
- const update = assignments.value[Number(key)];
85
- if (update === undefined) {
86
- updatedObject.splice(Number(key), 1);
87
- } else if (update instanceof InsertAssignment) {
88
- updatedObject.splice(Number(key), 0, update.value);
89
- } else {
90
- updatedObject[Number(key)] = immutableDeepAssign(
91
- updatedObject[key],
92
- update,
93
- );
94
- }
95
- }
96
- return Object.freeze(updatedObject);
97
- }
98
- if (typeof assignments === 'object' && !Array.isArray(assignments)) {
99
- assert(!Array.isArray(object), 'Expected an object. Got an array.');
100
- const updatedObject = {...object} as Mutable<typeof object>;
101
- const keys = Object.keys(assignments) as Array<keyof typeof assignments&keyof typeof updatedObject>;
102
- for (const key of keys) {
103
- const update = assignments[key];
104
- if (update === undefined) {
105
- delete updatedObject[key];
106
- } else {
107
- updatedObject[key] = immutableDeepAssign(
108
- updatedObject[key],
109
- update as typeof updatedObject[typeof key],
110
- );
111
- }
112
- }
113
- return Object.freeze(updatedObject);
114
- }
115
- return assignments as DeepImmutable<T>;
116
- };