chrome-devtools-frontend 1.0.1669021 → 1.0.1672388

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 (208) hide show
  1. package/.agents/skills/fixing-skipped-tests/SKILL.md +6 -6
  2. package/.agents/skills/gerrit-cli/SKILL.md +4 -10
  3. package/.agents/skills/gerrit-cli/references/commands.md +45 -2
  4. package/.agents/skills/gerrit-cli/references/workflows.md +7 -0
  5. package/.agents/skills/gerrit-cli/scripts/import_upstream.py +34 -152
  6. package/config/typescript/tsconfig.eslint.json +1 -1
  7. package/docs/contributing/settings-experiments-features.md +2 -8
  8. package/docs/ecosystem/automatic_workspace_folders.md +0 -19
  9. package/eslint.config.mjs +2 -2
  10. package/front_end/core/common/Lazy.ts +3 -3
  11. package/front_end/core/common/SettingRegistration.ts +0 -7
  12. package/front_end/core/common/Settings.ts +0 -38
  13. package/front_end/core/host/UserMetrics.ts +187 -953
  14. package/front_end/core/host/UserMetricsEnums.d.ts +949 -0
  15. package/front_end/core/root/Runtime.ts +21 -133
  16. package/front_end/core/sdk/CSSMetadata.ts +70 -65
  17. package/front_end/core/sdk/CategorizedBreakpoint.ts +0 -1
  18. package/front_end/core/sdk/ChildTargetManager.ts +0 -2
  19. package/front_end/core/sdk/EmulationModel.ts +0 -2
  20. package/front_end/core/sdk/EventBreakpointsModel.ts +0 -4
  21. package/front_end/core/sdk/NetworkManager.ts +0 -3
  22. package/front_end/core/sdk/PageResourceLoader.ts +9 -9
  23. package/front_end/core/sdk/RehydratingConnection.ts +52 -4
  24. package/front_end/core/sdk/Target.ts +0 -4
  25. package/front_end/devtools_compatibility.js +886 -0
  26. package/front_end/entrypoints/inspector_main/RenderingOptions.ts +7 -6
  27. package/front_end/entrypoints/main/ExecutionContextSelector.ts +0 -1
  28. package/front_end/entrypoints/main/MainImpl.ts +18 -22
  29. package/front_end/foundation/Universe.ts +7 -2
  30. package/front_end/generated/InspectorBackendCommands.ts +3 -10
  31. package/front_end/generated/protocol-mapping.d.ts +0 -42
  32. package/front_end/generated/protocol-proxy-api.d.ts +0 -38
  33. package/front_end/generated/protocol.ts +9 -169
  34. package/front_end/models/ai_assistance/AiAgent2.ts +11 -3
  35. package/front_end/models/ai_assistance/AiConversation.ts +1 -0
  36. package/front_end/models/ai_assistance/AiHistoryStorage.ts +8 -5
  37. package/front_end/models/ai_assistance/AiSetting.ts +108 -0
  38. package/front_end/models/ai_assistance/AiUtils.ts +47 -0
  39. package/front_end/models/ai_assistance/ChangeManager.ts +1 -0
  40. package/front_end/models/ai_assistance/ExtensionScope.ts +3 -12
  41. package/front_end/models/ai_assistance/agents/AiAgent.ts +11 -18
  42. package/front_end/models/ai_assistance/agents/ContextSelectionAgent.ts +3 -0
  43. package/front_end/models/ai_assistance/agents/ExecuteJavascript.ts +42 -17
  44. package/front_end/models/ai_assistance/agents/PerformanceAgent.ts +3 -2
  45. package/front_end/models/ai_assistance/agents/StorageAgent.ts +253 -155
  46. package/front_end/models/ai_assistance/agents/StylingAgent.snapshot.txt +2 -2
  47. package/front_end/models/ai_assistance/ai_assistance.ts +4 -0
  48. package/front_end/models/ai_assistance/contexts/PerformanceTraceContext.ts +12 -6
  49. package/front_end/models/ai_assistance/data_formatters/FileFormatter.ts +3 -1
  50. package/front_end/models/ai_assistance/data_formatters/NetworkRequestFormatter.ts +1 -0
  51. package/front_end/models/ai_assistance/data_formatters/PerformanceTraceFormatter.ts +1 -0
  52. package/front_end/models/ai_assistance/injected.ts +1 -0
  53. package/front_end/models/ai_assistance/performance/AICallTree.ts +1 -0
  54. package/front_end/models/ai_assistance/skills/Skill.ts +1 -1
  55. package/front_end/models/ai_assistance/skills/SkillRegistry.ts +2 -0
  56. package/front_end/models/ai_assistance/skills/performance.md +10 -0
  57. package/front_end/models/ai_assistance/tools/ExecuteJavaScript.ts +52 -5
  58. package/front_end/models/ai_assistance/tools/GetElementAccessibilityDetails.ts +4 -4
  59. package/front_end/models/ai_assistance/tools/GetLighthouseAudits.ts +4 -4
  60. package/front_end/models/ai_assistance/tools/GetNetworkRequestDetails.ts +5 -4
  61. package/front_end/models/ai_assistance/tools/GetStyles.ts +5 -4
  62. package/front_end/models/ai_assistance/tools/ListNetworkRequests.ts +5 -4
  63. package/front_end/models/ai_assistance/tools/README.md +1 -1
  64. package/front_end/models/ai_assistance/tools/RecordPerformanceTrace.ts +63 -0
  65. package/front_end/models/ai_assistance/tools/ResolveDevtoolsNodePath.ts +5 -5
  66. package/front_end/models/ai_assistance/tools/Tool.ts +118 -24
  67. package/front_end/models/ai_assistance/tools/ToolRegistry.ts +2 -0
  68. package/front_end/models/badges/UserBadges.ts +2 -0
  69. package/front_end/models/bindings/NetworkProject.ts +5 -0
  70. package/front_end/models/bindings/ResourceScriptMapping.ts +2 -0
  71. package/front_end/models/bindings/ResourceUtils.ts +3 -0
  72. package/front_end/models/crux-manager/CrUXManager.ts +1 -0
  73. package/front_end/models/emulation/DeviceModeModel.ts +140 -7
  74. package/front_end/models/emulation/EmulatedDevices.ts +246 -793
  75. package/front_end/models/issues_manager/IssuesManager.ts +10 -2
  76. package/front_end/models/live-metrics/LiveMetrics.ts +41 -9
  77. package/front_end/models/logs/LogManager.ts +8 -5
  78. package/front_end/models/logs/NetworkLog.ts +1 -0
  79. package/front_end/models/persistence/IsolatedFileSystemManager.ts +21 -3
  80. package/front_end/models/persistence/NetworkPersistenceManager.ts +6 -0
  81. package/front_end/models/project_settings/ProjectSettingsModel.ts +8 -12
  82. package/front_end/models/trace_source_maps_resolver/SourceMapsResolver.ts +3 -1
  83. package/front_end/models/workspace/IgnoreListManager.ts +2 -0
  84. package/front_end/models/workspace/UISourceCode.ts +2 -0
  85. package/front_end/models/workspace_diff/WorkspaceDiff.ts +4 -0
  86. package/front_end/panels/ai_assistance/AiAssistancePanel.ts +22 -22
  87. package/front_end/panels/ai_assistance/ai_assistance-meta.ts +0 -7
  88. package/front_end/panels/ai_assistance/components/ChatInput.ts +4 -0
  89. package/front_end/panels/ai_assistance/components/ChatMessage.ts +79 -34
  90. package/front_end/panels/ai_assistance/components/WalkthroughView.ts +1 -2
  91. package/front_end/panels/ai_assistance/components/walkthroughView.css +1 -1
  92. package/front_end/panels/application/ApplicationPanelSidebar.ts +9 -106
  93. package/front_end/panels/application/ApplicationPanelTreeElement.ts +1 -1
  94. package/front_end/panels/application/application.ts +0 -10
  95. package/front_end/panels/application/components/components.ts +0 -4
  96. package/front_end/panels/browser_debugger/CategorizedBreakpointsSidebarPane.ts +0 -5
  97. package/front_end/panels/browser_debugger/EventListenerBreakpointsSidebarPane.ts +6 -12
  98. package/front_end/panels/browser_debugger/browser_debugger-meta.ts +5 -3
  99. package/front_end/panels/console/ConsoleFormat.ts +2 -62
  100. package/front_end/panels/console/ConsoleViewMessage.ts +14 -7
  101. package/front_end/panels/emulation/AdvancedApp.ts +1 -2
  102. package/front_end/panels/emulation/DeviceModeToolbar.ts +83 -69
  103. package/front_end/panels/emulation/DeviceModeView.ts +4 -134
  104. package/front_end/panels/emulation/DeviceModeWrapper.ts +52 -69
  105. package/front_end/panels/emulation/MediaQueryInspector.ts +2 -2
  106. package/front_end/panels/emulation/emulation-meta.ts +12 -12
  107. package/front_end/panels/issues/IssuesPane.ts +3 -1
  108. package/front_end/panels/lighthouse/LighthouseController.ts +6 -0
  109. package/front_end/panels/linear_memory_inspector/components/LinearMemoryInspector.ts +17 -21
  110. package/front_end/panels/linear_memory_inspector/components/LinearMemoryNavigator.ts +206 -126
  111. package/front_end/panels/linear_memory_inspector/components/linearMemoryInspector.css +1 -1
  112. package/front_end/panels/mobile_throttling/CalibrationController.ts +1 -1
  113. package/front_end/panels/mobile_throttling/MobileThrottlingSelector.ts +3 -3
  114. package/front_end/panels/mobile_throttling/NetworkPanelIndicator.ts +6 -6
  115. package/front_end/panels/mobile_throttling/NetworkThrottlingSelector.ts +11 -11
  116. package/front_end/panels/mobile_throttling/ThrottlingManager.ts +13 -13
  117. package/front_end/panels/mobile_throttling/ThrottlingPresets.ts +10 -10
  118. package/front_end/panels/mobile_throttling/ThrottlingSettingsTab.ts +28 -28
  119. package/front_end/panels/mobile_throttling/mobile_throttling-meta.ts +6 -6
  120. package/front_end/panels/network/RequestHeadersView.ts +1 -1
  121. package/front_end/panels/network/ResourceChunkView.ts +243 -144
  122. package/front_end/panels/network/ResourceDirectSocketChunkView.ts +52 -29
  123. package/front_end/panels/network/ResourceWebSocketFrameView.ts +21 -35
  124. package/front_end/panels/network/resourceChunkView.css +41 -36
  125. package/front_end/panels/profiler/HeapDetachedElementsDataGrid.ts +21 -12
  126. package/front_end/panels/profiler/profiler.ts +4 -0
  127. package/front_end/panels/recorder/RecorderPanel.ts +6 -14
  128. package/front_end/panels/sensors/LocationsSettingsTab.ts +7 -7
  129. package/front_end/panels/settings/AISettingsTab.ts +75 -31
  130. package/front_end/panels/settings/SettingsScreen.ts +8 -13
  131. package/front_end/panels/settings/components/SyncSection.ts +3 -4
  132. package/front_end/panels/settings/emulation/DevicesSettingsTab.ts +200 -18
  133. package/front_end/panels/settings/emulation/devicesSettingsTab.css +18 -0
  134. package/front_end/panels/settings/settings-meta.ts +0 -1
  135. package/front_end/panels/sources/CategorizedBreakpointL10n.ts +0 -2
  136. package/front_end/panels/sources/DebuggerPausedMessage.ts +11 -5
  137. package/front_end/panels/sources/DebuggerPlugin.ts +1 -1
  138. package/front_end/panels/sources/EditingLocationHistoryManager.ts +12 -9
  139. package/front_end/panels/sources/SourcesPanel.ts +19 -17
  140. package/front_end/panels/sources/SourcesView.ts +191 -96
  141. package/front_end/panels/sources/TabbedEditorContainer.ts +3 -4
  142. package/front_end/panels/sources/WatchExpressionsSidebarPane.ts +2 -5
  143. package/front_end/panels/timeline/TimelineUIUtils.ts +15 -0
  144. package/front_end/panels/timeline/timeline-meta.ts +3 -5
  145. package/front_end/third_party/chromium/README.chromium +1 -1
  146. package/front_end/third_party/codemirror.next/chunk/angular.js +1 -1
  147. package/front_end/third_party/codemirror.next/chunk/codemirror.js +1 -1
  148. package/front_end/third_party/codemirror.next/chunk/codemirror.js.map +1 -1
  149. package/front_end/third_party/codemirror.next/chunk/cpp.js +1 -1
  150. package/front_end/third_party/codemirror.next/chunk/cpp.js.map +1 -1
  151. package/front_end/third_party/codemirror.next/chunk/java.js +1 -1
  152. package/front_end/third_party/codemirror.next/chunk/java.js.map +1 -1
  153. package/front_end/third_party/codemirror.next/chunk/legacy.js +1 -1
  154. package/front_end/third_party/codemirror.next/chunk/less.js +1 -1
  155. package/front_end/third_party/codemirror.next/chunk/less.js.map +1 -1
  156. package/front_end/third_party/codemirror.next/chunk/markdown.js +1 -1
  157. package/front_end/third_party/codemirror.next/chunk/markdown.js.map +1 -1
  158. package/front_end/third_party/codemirror.next/chunk/php.js +1 -1
  159. package/front_end/third_party/codemirror.next/chunk/php.js.map +1 -1
  160. package/front_end/third_party/codemirror.next/chunk/python.js +1 -1
  161. package/front_end/third_party/codemirror.next/chunk/python.js.map +1 -1
  162. package/front_end/third_party/codemirror.next/chunk/sass.js +1 -1
  163. package/front_end/third_party/codemirror.next/chunk/sass.js.map +1 -1
  164. package/front_end/third_party/codemirror.next/chunk/svelte.js +1 -1
  165. package/front_end/third_party/codemirror.next/chunk/svelte.js.map +1 -1
  166. package/front_end/third_party/codemirror.next/chunk/vue.js +1 -1
  167. package/front_end/third_party/codemirror.next/chunk/wast.js +1 -1
  168. package/front_end/third_party/codemirror.next/chunk/wast.js.map +1 -1
  169. package/front_end/third_party/codemirror.next/chunk/xml.js +1 -1
  170. package/front_end/third_party/codemirror.next/chunk/xml.js.map +1 -1
  171. package/front_end/third_party/codemirror.next/codemirror.next.d.ts +1332 -193
  172. package/front_end/third_party/codemirror.next/codemirror.next.js +1 -1
  173. package/front_end/third_party/codemirror.next/rebuild.sh +1 -1
  174. package/front_end/tsconfig.compatibility.json +2 -1
  175. package/front_end/tsconfig.json +1 -1
  176. package/front_end/ui/components/icon_button/IconButton.ts +1 -1
  177. package/front_end/ui/components/issue_counter/IssueCounter.ts +1 -1
  178. package/front_end/ui/components/settings/SettingCheckbox.ts +4 -7
  179. package/front_end/ui/components/settings/settings.ts +1 -2
  180. package/front_end/ui/legacy/Treeoutline.ts +52 -30
  181. package/front_end/ui/legacy/components/object_ui/CSSStyleSanitizer.ts +74 -0
  182. package/front_end/ui/legacy/components/object_ui/CustomPreviewComponent.ts +6 -1
  183. package/front_end/ui/legacy/components/object_ui/ObjectPropertiesSection.ts +47 -54
  184. package/front_end/ui/legacy/components/object_ui/object_ui.ts +2 -0
  185. package/front_end/ui/legacy/components/quick_open/CommandMenu.ts +5 -27
  186. package/front_end/ui/legacy/components/settings_ui/SettingsUI.ts +10 -12
  187. package/front_end/ui/settings/SettingUIRegistration.ts +0 -8
  188. package/front_end/ui/visual_logging/KnownContextValues.ts +21 -0
  189. package/inspector_overlay/tsconfig.json +8 -2
  190. package/package.json +3 -2
  191. package/.agents/skills/gerrit-cli/scripts/gerrit_client_wrapper.py +0 -47
  192. package/front_end/core/sdk/CSSModel.test.api.ts +0 -102
  193. package/front_end/core/sdk/DOMModel.test.api.ts +0 -104
  194. package/front_end/foundation/Universe.test.api.ts +0 -73
  195. package/front_end/panels/application/SharedStorageEventsView.ts +0 -128
  196. package/front_end/panels/application/SharedStorageItemsView.ts +0 -179
  197. package/front_end/panels/application/SharedStorageListTreeElement.ts +0 -65
  198. package/front_end/panels/application/SharedStorageModel.ts +0 -249
  199. package/front_end/panels/application/SharedStorageTreeElement.ts +0 -40
  200. package/front_end/panels/application/components/SharedStorageAccessGrid.ts +0 -191
  201. package/front_end/panels/application/components/SharedStorageMetadataView.ts +0 -133
  202. package/front_end/panels/application/components/sharedStorageAccessGrid.css +0 -29
  203. package/front_end/panels/application/components/sharedStorageMetadataView.css +0 -29
  204. package/front_end/panels/application/sharedStorageEventsView.css +0 -9
  205. package/front_end/panels/network/OriginalResourceChunkView.ts +0 -340
  206. package/front_end/panels/network/originalResourceChunkView.css +0 -49
  207. package/front_end/ui/components/settings/SettingDeprecationWarning.ts +0 -47
  208. package/front_end/ui/components/settings/settingDeprecationWarning.css +0 -14
@@ -1,191 +0,0 @@
1
- // Copyright 2022 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 '../../../ui/kit/kit.js';
6
- import '../../../ui/legacy/components/data_grid/data_grid.js';
7
-
8
- import * as i18n from '../../../core/i18n/i18n.js';
9
- import type * as Protocol from '../../../generated/protocol.js';
10
- import * as UI from '../../../ui/legacy/legacy.js';
11
- import * as Lit from '../../../ui/lit/lit.js';
12
- import * as VisualLogging from '../../../ui/visual_logging/visual_logging.js';
13
-
14
- import sharedStorageAccessGridStyles from './sharedStorageAccessGrid.css.js';
15
-
16
- const SHARED_STORAGE_EXPLANATION_URL =
17
- 'https://developers.google.com/privacy-sandbox/private-advertising/shared-storage';
18
-
19
- const {render, html} = Lit;
20
-
21
- const UIStrings = {
22
- /**
23
- * @description Text in Shared Storage Events View of the Application panel
24
- */
25
- sharedStorage: 'Shared storage',
26
- /**
27
- * @description Hover text for an info icon in the Shared Storage Events panel
28
- */
29
- allSharedStorageEvents: 'All shared storage events for this page.',
30
- /**
31
- * @description Text in Shared Storage Events View of the Application panel
32
- * Date and time of an Shared Storage event in a locale-
33
- * dependent format.
34
- */
35
- eventTime: 'Event Time',
36
- /**
37
- * @description Text in Shared Storage Events View of the Application panel
38
- * Scope of shared storage event such as 'window', 'sharedStorageWorklet',
39
- * or 'header'.
40
- */
41
- eventScope: 'Access Scope',
42
- /**
43
- * @description Text in Shared Storage Events View of the Application panel
44
- * Method of shared storage event such as 'addModule', 'run', 'set', 'delete',
45
- * or 'get'.
46
- */
47
- eventMethod: 'Access Method',
48
- /**
49
- * @description Text in Shared Storage Events View of the Application panel
50
- * Owner origin of the shared storage for this access event.
51
- */
52
- ownerOrigin: 'Owner Origin',
53
- /**
54
- * @description Text in Shared Storage Events View of the Application panel
55
- * Owner site of the shared storage for this access event.
56
- */
57
- ownerSite: 'Owner Site',
58
- /**
59
- * @description Text in Shared Storage Events View of the Application panel
60
- * Event parameters whose presence/absence depend on the access type.
61
- */
62
- eventParams: 'Optional Event Params',
63
- /**
64
- * @description Text shown when no shared storage event is shown.
65
- * Shared storage allows to store and access data that can be shared across different sites.
66
- * A shared storage event is for example an access from a site to that storage.
67
- */
68
- noEvents: 'No shared storage events detected',
69
- /**
70
- * @description Text shown when no shared storage event is shown. It explains the shared storage event page.
71
- * Shared storage allows to store and access data that can be shared across different sites.
72
- * A shared storage event is for example an access from a site to that storage.
73
- */
74
- sharedStorageDescription:
75
- 'On this page you can view, add, edit and delete shared storage key-value pairs and view shared storage events.',
76
- /**
77
- * @description Text used in a link to learn more about the topic.
78
- */
79
- learnMore: 'Learn more',
80
-
81
- } as const;
82
-
83
- const str_ = i18n.i18n.registerUIStrings('panels/application/components/SharedStorageAccessGrid.ts', UIStrings);
84
- export const i18nString = i18n.i18n.getLocalizedString.bind(undefined, str_);
85
-
86
- export interface ViewInput {
87
- events: Protocol.Storage.SharedStorageAccessedEvent[];
88
- onSelect: (event: Protocol.Storage.SharedStorageAccessedEvent) => void;
89
- }
90
- export type View = (input: ViewInput, output: object, target: HTMLElement) => void;
91
- export const DEFAULT_VIEW: View = (input, _output, target) => {
92
- // clang-format off
93
- render(html`
94
- <style>${sharedStorageAccessGridStyles}</style>
95
- ${input.events.length === 0
96
- ? html`
97
- <div class="empty-state" jslog=${VisualLogging.section().context('empty-view')}>
98
- <div class="empty-state-header">${i18nString(UIStrings.noEvents)}</div>
99
- <div class="empty-state-description">
100
- <span>${i18nString(UIStrings.sharedStorageDescription)}</span>
101
- <devtools-link
102
- class="devtools-link"
103
- href=${SHARED_STORAGE_EXPLANATION_URL}
104
- .jslogContext=${'learn-more'}
105
- >${i18nString(UIStrings.learnMore)}</devtools-link>
106
- </div>
107
- </div>`
108
- : html`
109
- <div jslog=${VisualLogging.section('events-table')}>
110
- <span class="heading">${i18nString(UIStrings.sharedStorage)}</span>
111
- <devtools-icon class="info-icon medium" name="info"
112
- title=${i18nString(UIStrings.allSharedStorageEvents)}>
113
- </devtools-icon>
114
- <devtools-data-grid striped inline>
115
- <table>
116
- <thead>
117
- <tr>
118
- <th id="event-time" weight="10" sortable>
119
- ${i18nString(UIStrings.eventTime)}
120
- </th>
121
- <th id="event-scope" weight="10" sortable>
122
- ${i18nString(UIStrings.eventScope)}
123
- </th>
124
- <th id="event-method" weight="10" sortable>
125
- ${i18nString(UIStrings.eventMethod)}
126
- </th>
127
- <th id="event-owner-origin" weight="10" sortable>
128
- ${i18nString(UIStrings.ownerOrigin)}
129
- </th>
130
- <th id="event-owner-site" weight="10" sortable>
131
- ${i18nString(UIStrings.ownerSite)}
132
- </th>
133
- <th id="event-params" weight="10" sortable>
134
- ${i18nString(UIStrings.eventParams)}
135
- </th>
136
- </tr>
137
- </thead>
138
- <tbody>
139
- ${input.events.map(event => html`
140
- <tr @select=${() =>input.onSelect(event)}>
141
- <td data-value=${event.accessTime}>
142
- ${new Date(1e3 * event.accessTime).toLocaleString()}
143
- </td>
144
- <td>${event.scope}</td>
145
- <td>${event.method}</td>
146
- <td>${event.ownerOrigin}</td>
147
- <td>${event.ownerSite}</td>
148
- <td>${JSON.stringify(event.params)}</td>
149
- </tr>
150
- `)}
151
- </tbody>
152
- </table>
153
- </devtools-data-grid>
154
- </div>`}`, target);
155
- // clang-format on
156
- };
157
-
158
- export class SharedStorageAccessGrid extends UI.Widget.Widget {
159
- readonly #view: View;
160
- #events: Protocol.Storage.SharedStorageAccessedEvent[] = [];
161
- #onSelect: (event: Protocol.Storage.SharedStorageAccessedEvent) => void = () => {};
162
-
163
- constructor(element?: HTMLElement, view: View = DEFAULT_VIEW) {
164
- super(element, {useShadowDom: true});
165
- this.#view = view;
166
- this.performUpdate();
167
- }
168
-
169
- set events(events: Protocol.Storage.SharedStorageAccessedEvent[]) {
170
- this.#events = events;
171
- this.performUpdate();
172
- }
173
-
174
- set onSelect(onSelect: (event: Protocol.Storage.SharedStorageAccessedEvent) => unknown) {
175
- this.#onSelect = onSelect;
176
- this.performUpdate();
177
- }
178
-
179
- get onSelect(): (event: Protocol.Storage.SharedStorageAccessedEvent) => unknown {
180
- return this.#onSelect;
181
- }
182
-
183
- override performUpdate(): void {
184
- this.#view(
185
- {
186
- events: this.#events,
187
- onSelect: this.#onSelect.bind(this),
188
- },
189
- {}, this.contentElement);
190
- }
191
- }
@@ -1,133 +0,0 @@
1
- // Copyright 2022 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 '../../../ui/kit/kit.js';
6
-
7
- import * as i18n from '../../../core/i18n/i18n.js';
8
- import type * as Protocol from '../../../generated/protocol.js';
9
- import * as Buttons from '../../../ui/components/buttons/buttons.js';
10
- import * as Lit from '../../../ui/lit/lit.js';
11
-
12
- import sharedStorageMetadataViewStyles from './sharedStorageMetadataView.css.js';
13
- import {StorageMetadataView} from './StorageMetadataView.js';
14
-
15
- const {html} = Lit;
16
-
17
- const UIStrings = {
18
- /**
19
- * @description Text in SharedStorage Metadata View of the Application panel
20
- */
21
- sharedStorage: 'Shared storage',
22
- /**
23
- * @description The time when the origin most recently created its shared storage database
24
- */
25
- creation: 'Creation Time',
26
- /**
27
- * @description The placeholder text if there is no creation time because the origin is not yet using shared storage.
28
- */
29
- notYetCreated: 'Not yet created',
30
- /**
31
- * @description The number of entries currently in the origin's database
32
- */
33
- numEntries: 'Number of Entries',
34
- /**
35
- * @description The number of bits remaining in the origin's shared storage privacy budget
36
- */
37
- entropyBudget: 'Entropy Budget for Fenced Frames',
38
- /**
39
- * @description Hover text for `entropyBudget` giving a more detailed explanation
40
- */
41
- budgetExplanation: 'Remaining data leakage allowed within a 24-hour period for this origin in bits of entropy',
42
- /**
43
- * @description Label for a button which when clicked causes the budget to be reset to the max.
44
- */
45
- resetBudget: 'Reset Budget',
46
- /**
47
- * @description The number of bytes used by entries currently in the origin's database
48
- */
49
- numBytesUsed: 'Number of Bytes Used',
50
- } as const;
51
- const str_ = i18n.i18n.registerUIStrings('panels/application/components/SharedStorageMetadataView.ts', UIStrings);
52
- const i18nString = i18n.i18n.getLocalizedString.bind(undefined, str_);
53
-
54
- interface SharedStorageMetadataGetter {
55
- getMetadata: () => Promise<Protocol.Storage.SharedStorageMetadata|null>;
56
- resetBudget: () => Promise<void>;
57
- }
58
-
59
- export class SharedStorageMetadataView extends StorageMetadataView {
60
- #sharedStorageMetadataGetter: SharedStorageMetadataGetter;
61
- #creationTime: Protocol.Network.TimeSinceEpoch|null = null;
62
- #length = 0;
63
- #bytesUsed = 0;
64
- #remainingBudget = 0;
65
-
66
- constructor(sharedStorageMetadataGetter: SharedStorageMetadataGetter, owner: string) {
67
- super();
68
- this.#sharedStorageMetadataGetter = sharedStorageMetadataGetter;
69
- this.classList.add('overflow-auto');
70
- this.setStorageKey(owner);
71
- }
72
-
73
- async #resetBudget(): Promise<void> {
74
- await this.#sharedStorageMetadataGetter.resetBudget();
75
- await this.render();
76
- }
77
-
78
- override getTitle(): string {
79
- return i18nString(UIStrings.sharedStorage);
80
- }
81
-
82
- override async renderReportContent(): Promise<Lit.LitTemplate> {
83
- const metadata = await this.#sharedStorageMetadataGetter.getMetadata();
84
- this.#creationTime = metadata?.creationTime ?? null;
85
- this.#length = metadata?.length ?? 0;
86
- this.#bytesUsed = metadata?.bytesUsed ?? 0;
87
- this.#remainingBudget = metadata?.remainingBudget ?? 0;
88
-
89
- // Disabled until https://crbug.com/1079231 is fixed.
90
- // clang-format off
91
- return html`
92
- <style>${sharedStorageMetadataViewStyles}</style>
93
- ${await super.renderReportContent()}
94
- ${this.key(i18nString(UIStrings.creation))}
95
- ${this.value(this.#renderDateForCreationTime())}
96
- ${this.key(i18nString(UIStrings.numEntries))}
97
- ${this.value(String(this.#length))}
98
- ${this.key(i18nString(UIStrings.numBytesUsed))}
99
- ${this.value(String(this.#bytesUsed))}
100
- ${this.key(html`<span class="entropy-budget">${i18nString(UIStrings.entropyBudget)}<devtools-icon name="info" title=${i18nString(UIStrings.budgetExplanation)}></devtools-icon></span>`)}
101
- ${this.value(html`<span class="entropy-budget">${this.#remainingBudget}${this.#renderResetBudgetButton()}</span>`)}`;
102
- // clang-format on
103
- }
104
-
105
- #renderDateForCreationTime(): Lit.TemplateResult {
106
- if (!this.#creationTime) {
107
- return html`${i18nString(UIStrings.notYetCreated)}`;
108
- }
109
- const date = new Date(1e3 * (this.#creationTime));
110
- return html`${date.toLocaleString()}`;
111
- }
112
-
113
- #renderResetBudgetButton(): Lit.TemplateResult {
114
- // clang-format off
115
- return html`
116
- <devtools-button .iconName=${'undo'}
117
- .jslogContext=${'reset-entropy-budget'}
118
- .size=${Buttons.Button.Size.SMALL}
119
- .title=${i18nString(UIStrings.resetBudget)}
120
- .variant=${Buttons.Button.Variant.ICON}
121
- @click=${this.#resetBudget.bind(this)}></devtools-button>
122
- `;
123
- // clang-format on
124
- }
125
- }
126
-
127
- customElements.define('devtools-shared-storage-metadata-view', SharedStorageMetadataView);
128
-
129
- declare global {
130
- interface HTMLElementTagNameMap {
131
- 'devtools-shared-storage-metadata-view': SharedStorageMetadataView;
132
- }
133
- }
@@ -1,29 +0,0 @@
1
- /*
2
- * Copyright 2022 The Chromium Authors
3
- * Use of this source code is governed by a BSD-style license that can be
4
- * found in the LICENSE file.
5
- */
6
- @scope to (devtools-widget > *) {
7
- :scope {
8
- padding: 20px;
9
- height: 100%;
10
- display: flex;
11
- }
12
-
13
- .heading {
14
- font-size: 15px;
15
- }
16
-
17
- devtools-data-grid {
18
- margin-top: 20px;
19
- }
20
-
21
- .info-icon {
22
- vertical-align: text-bottom;
23
- height: 14px;
24
- }
25
-
26
- .no-events-message {
27
- margin-top: 20px;
28
- }
29
- }
@@ -1,29 +0,0 @@
1
- /*
2
- * Copyright 2022 The Chromium Authors
3
- * Use of this source code is governed by a BSD-style license that can be
4
- * found in the LICENSE file.
5
- */
6
-
7
- .text-ellipsis {
8
- overflow: hidden;
9
- text-overflow: ellipsis;
10
- white-space: nowrap;
11
- }
12
-
13
- devtools-icon {
14
- vertical-align: text-bottom;
15
- margin-left: var(--sys-size-3);
16
- width: 16px;
17
- height: 16px;
18
- }
19
-
20
- devtools-button {
21
- vertical-align: sub;
22
- margin-left: var(--sys-size-3);
23
- }
24
-
25
- .entropy-budget {
26
- display: flex;
27
- align-items: center;
28
- height: 18px;
29
- }
@@ -1,9 +0,0 @@
1
- /*
2
- * Copyright 2022 The Chromium Authors
3
- * Use of this source code is governed by a BSD-style license that can be
4
- * found in the LICENSE file.
5
- */
6
-
7
- devtools-shared-storage-access-grid {
8
- overflow: auto;
9
- }