chrome-devtools-frontend 1.0.980472 → 1.0.982087

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 (65) hide show
  1. package/front_end/core/common/ParsedURL.ts +42 -4
  2. package/front_end/core/host/InspectorFrontendHost.ts +7 -6
  3. package/front_end/core/host/InspectorFrontendHostAPI.ts +8 -8
  4. package/front_end/core/i18n/locales/en-US.json +15 -0
  5. package/front_end/core/i18n/locales/en-XL.json +15 -0
  6. package/front_end/core/platform/DevToolsPath.ts +3 -0
  7. package/front_end/core/sdk/CSSRule.ts +2 -2
  8. package/front_end/core/sdk/DOMDebuggerModel.ts +2 -2
  9. package/front_end/core/sdk/NetworkRequest.ts +1 -1
  10. package/front_end/core/sdk/SourceMap.ts +14 -5
  11. package/front_end/core/sdk/Target.ts +4 -3
  12. package/front_end/generated/InspectorBackendCommands.js +6 -2
  13. package/front_end/generated/protocol.ts +16 -0
  14. package/front_end/legacy_test_runner/bindings_test_runner/BindingsTestRunner.js +5 -0
  15. package/front_end/models/bindings/BreakpointManager.ts +0 -2
  16. package/front_end/models/bindings/ContentProviderBasedProject.ts +6 -4
  17. package/front_end/models/bindings/FileUtils.ts +3 -2
  18. package/front_end/models/persistence/EditFileSystemView.ts +3 -1
  19. package/front_end/models/persistence/FileSystemWorkspaceBinding.ts +14 -9
  20. package/front_end/models/persistence/IsolatedFileSystem.ts +66 -40
  21. package/front_end/models/persistence/IsolatedFileSystemManager.ts +4 -3
  22. package/front_end/models/persistence/NetworkPersistenceManager.ts +6 -5
  23. package/front_end/models/persistence/PlatformFileSystem.ts +15 -10
  24. package/front_end/models/timeline_model/TimelineModel.ts +1 -0
  25. package/front_end/models/workspace/FileManager.ts +9 -6
  26. package/front_end/models/workspace/UISourceCode.ts +4 -2
  27. package/front_end/models/workspace/WorkspaceImpl.ts +9 -5
  28. package/front_end/panels/application/BackgroundServiceView.ts +2 -1
  29. package/front_end/panels/application/ServiceWorkerCacheViews.ts +1 -1
  30. package/front_end/panels/console/ConsoleFormat.ts +23 -0
  31. package/front_end/panels/console/ConsoleView.ts +3 -1
  32. package/front_end/panels/console/ConsoleViewMessage.ts +3 -19
  33. package/front_end/panels/coverage/CoverageView.ts +2 -1
  34. package/front_end/panels/emulation/AdvancedApp.ts +6 -2
  35. package/front_end/panels/emulation/DeviceModeToolbar.ts +2 -1
  36. package/front_end/panels/input/InputTimeline.ts +2 -1
  37. package/front_end/panels/lighthouse/LighthouseReportRenderer.ts +1 -1
  38. package/front_end/panels/network/NetworkLogView.ts +2 -2
  39. package/front_end/panels/network/ResourceWebSocketFrameView.ts +1 -2
  40. package/front_end/panels/profiler/HeapSnapshotView.ts +3 -2
  41. package/front_end/panels/profiler/ProfileView.ts +2 -2
  42. package/front_end/panels/protocol_monitor/ProtocolMonitor.ts +4 -2
  43. package/front_end/panels/screencast/ScreencastView.ts +4 -1
  44. package/front_end/panels/settings/SettingsScreen.ts +4 -1
  45. package/front_end/panels/snippets/ScriptSnippetFileSystem.ts +25 -19
  46. package/front_end/panels/sources/NavigatorView.ts +9 -5
  47. package/front_end/panels/sources/SourcesNavigator.ts +2 -2
  48. package/front_end/panels/sources/components/HeadersView.css +17 -2
  49. package/front_end/panels/sources/components/HeadersView.ts +102 -0
  50. package/front_end/panels/timeline/TimelinePanel.ts +2 -1
  51. package/front_end/panels/timeline/TimelineUIUtils.ts +7 -0
  52. package/front_end/third_party/lighthouse/lighthouse-dt-bundle.js +963 -886
  53. package/front_end/third_party/lighthouse/report/bundle.js +3 -2
  54. package/front_end/third_party/lighthouse/report-assets/report-generator.mjs +1 -1
  55. package/front_end/ui/components/buttons/Button.ts +11 -1
  56. package/front_end/ui/components/buttons/button.css +31 -10
  57. package/front_end/ui/components/docs/button/basic.ts +47 -1
  58. package/front_end/ui/components/panel_feedback/FeedbackButton.ts +4 -1
  59. package/front_end/ui/legacy/XLink.ts +8 -3
  60. package/front_end/ui/legacy/components/color_picker/ContrastDetails.ts +3 -1
  61. package/front_end/ui/legacy/components/utils/ImagePreview.ts +6 -2
  62. package/front_end/ui/legacy/components/utils/Linkifier.ts +7 -2
  63. package/front_end/ui/legacy/tabbedPane.css +1 -0
  64. package/front_end/ui/legacy/themeColors.css +4 -0
  65. package/package.json +1 -1
@@ -18,6 +18,7 @@ export const enum Variant {
18
18
  PRIMARY = 'primary',
19
19
  SECONDARY = 'secondary',
20
20
  TOOLBAR = 'toolbar',
21
+ ROUND = 'round',
21
22
  }
22
23
 
23
24
  export const enum Size {
@@ -40,7 +41,7 @@ interface ButtonState {
40
41
  }
41
42
 
42
43
  export type ButtonData = {
43
- variant: Variant.TOOLBAR,
44
+ variant: Variant.TOOLBAR|Variant.ROUND,
44
45
  iconUrl: string,
45
46
  size?: Size,
46
47
  disabled?: boolean,
@@ -199,10 +200,19 @@ export class Button extends HTMLElement {
199
200
  throw new Error('Tooblar button does not accept children');
200
201
  }
201
202
  }
203
+ if (this.#props.variant === Variant.ROUND) {
204
+ if (!this.#props.iconUrl) {
205
+ throw new Error('Round button requires an icon');
206
+ }
207
+ if (!this.#isEmpty) {
208
+ throw new Error('Round button does not accept children');
209
+ }
210
+ }
202
211
  const classes = {
203
212
  primary: this.#props.variant === Variant.PRIMARY,
204
213
  secondary: this.#props.variant === Variant.SECONDARY,
205
214
  toolbar: this.#props.variant === Variant.TOOLBAR,
215
+ round: this.#props.variant === Variant.ROUND,
206
216
  'text-with-icon': Boolean(this.#props.iconUrl) && !this.#isEmpty,
207
217
  'only-icon': Boolean(this.#props.iconUrl) && this.#isEmpty,
208
218
  small: Boolean(this.#props.size === Size.SMALL),
@@ -49,7 +49,8 @@ button:focus-visible {
49
49
  box-shadow: 0 0 0 2px var(--color-button-outline-focus);
50
50
  }
51
51
 
52
- button.toolbar {
52
+ button.toolbar,
53
+ button.round {
53
54
  background: transparent;
54
55
  border-radius: 2px;
55
56
  border: none;
@@ -60,11 +61,22 @@ button.toolbar {
60
61
  white-space: nowrap;
61
62
  }
62
63
 
64
+ button.round {
65
+ border-radius: 100%;
66
+ height: 30px;
67
+ width: 30px;
68
+ }
69
+
63
70
  button.toolbar.small {
64
71
  height: 18px;
65
72
  width: 18px;
66
73
  }
67
74
 
75
+ button.round.small {
76
+ height: 24px;
77
+ width: 24px;
78
+ }
79
+
68
80
  button.primary {
69
81
  border: 1px solid var(--color-primary);
70
82
  background: var(--color-primary);
@@ -123,21 +135,27 @@ button.secondary:active:focus-visible {
123
135
  border: 1px solid var(--color-button-secondary-background-pressed);
124
136
  }
125
137
 
126
- button.toolbar:hover {
127
- background-color: var(--color-button-secondary-background-hovering);
138
+ button.toolbar:hover,
139
+ button.round:hover {
140
+ background-color: var(--color-iconbutton-hover);
128
141
  }
129
142
 
130
143
  button.toolbar.active,
131
- button.toolbar:active {
132
- background-color: var(--color-button-secondary-background-pressed);
144
+ button.toolbar:active,
145
+ button.round.active,
146
+ button.round:active {
147
+ background-color: var(--color-iconbutton-pressed);
133
148
  }
134
149
 
135
- button.toolbar:focus-visible {
150
+ button.toolbar:focus-visible,
151
+ button.round:focus-visible {
136
152
  background-color: var(--color-background-elevation-2);
137
153
  }
138
154
 
139
155
  button.toolbar:disabled,
140
- button.toolbar:disabled:hover {
156
+ button.toolbar:disabled:hover,
157
+ button.round:disabled,
158
+ button.round:disabled:hover {
141
159
  background: var(--color-background);
142
160
  color: var(--color-text-disabled);
143
161
  cursor: not-allowed;
@@ -160,7 +178,8 @@ button devtools-icon {
160
178
  height: 19px;
161
179
  }
162
180
 
163
- button.toolbar devtools-icon {
181
+ button.toolbar devtools-icon,
182
+ button.round devtools-icon {
164
183
  width: 24px;
165
184
  height: 24px;
166
185
 
@@ -180,7 +199,8 @@ button.small devtools-icon {
180
199
  height: 14px;
181
200
  }
182
201
 
183
- button.toolbar.small devtools-icon {
202
+ button.toolbar.small devtools-icon,
203
+ button.round.small devtools-icon {
184
204
  width: 18px;
185
205
  height: 18px;
186
206
  }
@@ -194,7 +214,8 @@ button.toolbar:hover devtools-icon {
194
214
  --icon-color: var(--color-text-primary);
195
215
  }
196
216
 
197
- button.toolbar:disabled devtools-icon {
217
+ button.toolbar:disabled devtools-icon,
218
+ button.round:disabled devtools-icon {
198
219
  --icon-color: var(--color-text-disabled);
199
220
  }
200
221
 
@@ -190,7 +190,7 @@ disabledPrimaryIconButton.data = {
190
190
  disabledPrimaryIconButton.onclick = () => alert('clicked');
191
191
  appendButton(disabledPrimaryIconButton);
192
192
 
193
- // Disabled Secondary Icon Only
193
+ // Small Disabled Secondary Icon Only
194
194
  const disabledSecondaryIconOnlyButton = new Buttons.Button.Button();
195
195
  disabledSecondaryIconOnlyButton.onclick = () => alert('clicked');
196
196
  disabledSecondaryIconOnlyButton.style.width = '18px';
@@ -202,6 +202,50 @@ disabledSecondaryIconOnlyButton.data = {
202
202
  };
203
203
  appendButton(disabledSecondaryIconOnlyButton);
204
204
 
205
+ // Round Button
206
+ const roundButton = new Buttons.Button.Button();
207
+ roundButton.data = {
208
+ variant: Buttons.Button.Variant.ROUND,
209
+ iconUrl: testIcon,
210
+ };
211
+ roundButton.title = 'Round Button';
212
+ roundButton.onclick = () => alert('clicked');
213
+ appendButton(roundButton);
214
+
215
+ // Disabled Round Button
216
+ const roundButtonDisabled = new Buttons.Button.Button();
217
+ roundButtonDisabled.data = {
218
+ variant: Buttons.Button.Variant.ROUND,
219
+ iconUrl: testIcon,
220
+ disabled: true,
221
+ };
222
+ roundButtonDisabled.title = 'Disabled Round Button';
223
+ roundButtonDisabled.onclick = () => alert('clicked');
224
+ appendButton(roundButtonDisabled);
225
+
226
+ // Small Round Button
227
+ const smallRoundButton = new Buttons.Button.Button();
228
+ smallRoundButton.data = {
229
+ variant: Buttons.Button.Variant.ROUND,
230
+ iconUrl: testIcon,
231
+ size: Buttons.Button.Size.SMALL,
232
+ };
233
+ smallRoundButton.title = 'Small Round Button';
234
+ smallRoundButton.onclick = () => alert('clicked');
235
+ appendButton(smallRoundButton);
236
+
237
+ // Small Disabled Round Button
238
+ const smallRoundButtonDisabled = new Buttons.Button.Button();
239
+ smallRoundButtonDisabled.data = {
240
+ variant: Buttons.Button.Variant.ROUND,
241
+ iconUrl: testIcon,
242
+ disabled: true,
243
+ size: Buttons.Button.Size.SMALL,
244
+ };
245
+ smallRoundButtonDisabled.title = 'Small Disabled Round Button';
246
+ smallRoundButtonDisabled.onclick = () => alert('clicked');
247
+ appendButton(smallRoundButtonDisabled);
248
+
205
249
  for (let i = 0; i < 6; i++) {
206
250
  // Regular Toolbar Button
207
251
  const toolbarButton = new Buttons.Button.Button();
@@ -245,6 +289,7 @@ for (let i = 0; i < 6; i++) {
245
289
  }
246
290
  }
247
291
 
292
+ // Submit Button
248
293
  const submitButton = new Buttons.Button.Button();
249
294
  submitButton.data = {
250
295
  variant: Buttons.Button.Variant.PRIMARY,
@@ -253,6 +298,7 @@ submitButton.data = {
253
298
  submitButton.innerText = 'Submit';
254
299
  document.querySelector('#form')?.append(submitButton);
255
300
 
301
+ // Reset Button
256
302
  const resetButton = new Buttons.Button.Button();
257
303
  resetButton.data = {
258
304
  variant: Buttons.Button.Variant.SECONDARY,
@@ -4,6 +4,7 @@
4
4
 
5
5
  import * as Host from '../../../core/host/host.js';
6
6
  import * as i18n from '../../../core/i18n/i18n.js';
7
+ import type * as Platform from '../../../core/platform/platform.js';
7
8
  import * as ComponentHelpers from '../../components/helpers/helpers.js';
8
9
  import * as LitHtml from '../../lit-html/lit-html.js';
9
10
  import * as Buttons from '../buttons/buttons.js';
@@ -38,7 +39,9 @@ export class FeedbackButton extends HTMLElement {
38
39
  }
39
40
 
40
41
  #onFeedbackClick(): void {
41
- Host.InspectorFrontendHost.InspectorFrontendHostInstance.openInNewTab(this.#props.feedbackUrl);
42
+ // TODO(crbug.com/1253323): Cast to UrlString will be removed when migration to branded types is complete.
43
+ Host.InspectorFrontendHost.InspectorFrontendHostInstance.openInNewTab(
44
+ this.#props.feedbackUrl as Platform.DevToolsPath.UrlString);
42
45
  }
43
46
 
44
47
  #render(): void {
@@ -2,6 +2,8 @@
2
2
  // Use of this source code is governed by a BSD-style license that can be
3
3
  // found in the LICENSE file.
4
4
 
5
+ // TODO(crbug.com/1253323): Casts to UrlString will be removed from this file when migration to branded types is complete.
6
+
5
7
  import * as Host from '../../core/host/host.js';
6
8
  import * as Platform from '../../core/platform/platform.js';
7
9
  import * as ComponentHelpers from '../components/helpers/helpers.js';
@@ -47,13 +49,15 @@ export class XLink extends XElement {
47
49
 
48
50
  this.onClick = (event: Event): void => {
49
51
  event.consume(true);
50
- Host.InspectorFrontendHost.InspectorFrontendHostInstance.openInNewTab((this.hrefInternal as string));
52
+ Host.InspectorFrontendHost.InspectorFrontendHostInstance.openInNewTab(
53
+ (this.hrefInternal as Platform.DevToolsPath.UrlString));
51
54
  this.dispatchEvent(new Event('x-link-invoke'));
52
55
  };
53
56
  this.onKeyDown = (event: Event): void => {
54
57
  if (isEnterOrSpaceKey(event)) {
55
58
  event.consume(true);
56
- Host.InspectorFrontendHost.InspectorFrontendHostInstance.openInNewTab((this.hrefInternal as string));
59
+ Host.InspectorFrontendHost.InspectorFrontendHostInstance.openInNewTab(
60
+ (this.hrefInternal as Platform.DevToolsPath.UrlString));
57
61
  }
58
62
  this.dispatchEvent(new Event('x-link-invoke'));
59
63
  };
@@ -138,7 +142,8 @@ export class ContextMenuProvider implements Provider {
138
142
  const node: XLink = targetNode;
139
143
  contextMenu.revealSection().appendItem(openLinkExternallyLabel(), () => {
140
144
  if (node.href) {
141
- Host.InspectorFrontendHost.InspectorFrontendHostInstance.openInNewTab(node.href);
145
+ Host.InspectorFrontendHost.InspectorFrontendHostInstance.openInNewTab(
146
+ node.href as Platform.DevToolsPath.UrlString);
142
147
  }
143
148
  });
144
149
  contextMenu.revealSection().appendItem(copyLinkAddressLabel(), () => {
@@ -359,8 +359,10 @@ export class ContrastDetails extends Common.ObjectWrapper.ObjectWrapper<EventTyp
359
359
  }
360
360
 
361
361
  private static showHelp(): void {
362
+ // TODO(crbug.com/1253323): Cast to UrlString will be removed when migration to branded types is complete.
362
363
  Host.InspectorFrontendHost.InspectorFrontendHostInstance.openInNewTab(
363
- UI.UIUtils.addReferrerToURL('https://web.dev/color-and-contrast-accessibility/'));
364
+ UI.UIUtils.addReferrerToURL('https://web.dev/color-and-contrast-accessibility/') as
365
+ Platform.DevToolsPath.UrlString);
364
366
  }
365
367
 
366
368
  setVisible(visible: boolean): void {
@@ -2,6 +2,8 @@
2
2
  // Use of this source code is governed by a BSD-style license that can be
3
3
  // found in the LICENSE file.
4
4
 
5
+ // TODO(crbug.com/1253323): Casts to UrlString will be removed from this file when migration to branded types is complete.
6
+
5
7
  import * as Common from '../../../../core/common/common.js';
6
8
  import * as Host from '../../../../core/host/host.js';
7
9
  import * as i18n from '../../../../core/i18n/i18n.js';
@@ -113,7 +115,8 @@ export class ImagePreview {
113
115
 
114
116
  // Open image in new tab.
115
117
  link.addEventListener('click', () => {
116
- Host.InspectorFrontendHost.InspectorFrontendHostInstance.openInNewTab(imageURL);
118
+ Host.InspectorFrontendHost.InspectorFrontendHostInstance.openInNewTab(
119
+ imageURL as Platform.DevToolsPath.UrlString);
117
120
  });
118
121
 
119
122
  const intrinsicWidth = imageElement.naturalWidth;
@@ -158,7 +161,8 @@ export class ImagePreview {
158
161
  HTMLLinkElement);
159
162
  sourceLink.textContent = sourceText;
160
163
  sourceLink.addEventListener('click', () => {
161
- Host.InspectorFrontendHost.InspectorFrontendHostInstance.openInNewTab(imageURL);
164
+ Host.InspectorFrontendHost.InspectorFrontendHostInstance.openInNewTab(
165
+ imageURL as Platform.DevToolsPath.UrlString);
162
166
  });
163
167
  resolve(shadowBoundary);
164
168
  }
@@ -31,6 +31,7 @@
31
31
  import * as Common from '../../../../core/common/common.js';
32
32
  import * as Host from '../../../../core/host/host.js';
33
33
  import * as i18n from '../../../../core/i18n/i18n.js';
34
+ import type * as Platform from '../../../../core/platform/platform.js';
34
35
  import * as SDK from '../../../../core/sdk/sdk.js';
35
36
  import * as Bindings from '../../../../models/bindings/bindings.js';
36
37
  import * as TextUtils from '../../../../models/text_utils/text_utils.js';
@@ -749,10 +750,12 @@ export class Linkifier implements SDK.TargetManager.Observer {
749
750
  }
750
751
  }
751
752
  if (resource || info.url) {
753
+ // TODO(crbug.com/1253323): Cast to UrlString will be removed when migration to branded types is complete.
752
754
  result.push({
753
755
  section: 'reveal',
754
756
  title: UI.UIUtils.openLinkExternallyLabel(),
755
- handler: (): void => Host.InspectorFrontendHost.InspectorFrontendHostInstance.openInNewTab(url),
757
+ handler: (): void => Host.InspectorFrontendHost.InspectorFrontendHostInstance.openInNewTab(
758
+ url as Platform.DevToolsPath.UrlString),
756
759
  });
757
760
  result.push({
758
761
  section: 'clipboard',
@@ -916,7 +919,9 @@ export class ContentProviderContextMenuProvider implements UI.ContextMenu.Provid
916
919
  contextMenu.revealSection().appendItem(
917
920
  UI.UIUtils.openLinkExternallyLabel(),
918
921
  () => Host.InspectorFrontendHost.InspectorFrontendHostInstance.openInNewTab(
919
- contentUrl.endsWith(':formatted') ? contentUrl.slice(0, contentUrl.lastIndexOf(':')) : contentUrl));
922
+ contentUrl.endsWith(':formatted') ?
923
+ Common.ParsedURL.ParsedURL.slice(contentUrl, 0, contentUrl.lastIndexOf(':')) :
924
+ contentUrl));
920
925
  for (const title of linkHandlers.keys()) {
921
926
  const handler = linkHandlers.get(title);
922
927
  if (!handler) {
@@ -98,6 +98,7 @@
98
98
  pointer-events: none;
99
99
  margin-left: 0;
100
100
  position: relative;
101
+ cursor: default;
101
102
  }
102
103
 
103
104
  .tabbed-pane-header-contents > * {
@@ -127,6 +127,8 @@
127
127
  --color-button-secondary-background-hovering: rgb(26 115 232 / 10%);
128
128
  --color-button-secondary-background-pressed: rgb(26 92 178 / 25%);
129
129
  --color-button-secondary-border: rgb(218 220 224);
130
+ --color-iconbutton-hover: rgb(0 0 0 / 10%);
131
+ --color-iconbutton-pressed: rgb(0 0 0 / 15%);
130
132
 
131
133
  /* Colors for file icons */
132
134
  --color-ic-file-document: rgb(39 116 240);
@@ -273,6 +275,8 @@
273
275
  --color-button-secondary-background-hovering: rgb(138 180 248 / 15%);
274
276
  --color-button-secondary-background-pressed: rgb(138 180 248 / 23%);
275
277
  --color-button-secondary-border: rgb(60 61 65);
278
+ --color-iconbutton-hover: rgb(255 255 255 / 12%);
279
+ --color-iconbutton-pressed: rgb(255 255 255 / 20%);
276
280
 
277
281
  /* Colors for file icons */
278
282
  --color-ic-file-document: rgb(39 116 240);
package/package.json CHANGED
@@ -54,5 +54,5 @@
54
54
  "unittest": "scripts/test/run_unittests.py --no-text-coverage",
55
55
  "watch": "third_party/node/node.py --output scripts/watch_build.js"
56
56
  },
57
- "version": "1.0.980472"
57
+ "version": "1.0.982087"
58
58
  }