chrome-devtools-frontend 1.0.1646714 → 1.0.1649421

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 (42) hide show
  1. package/extension-api/ExtensionAPI.d.ts +26 -0
  2. package/front_end/core/common/Debouncer.ts +9 -1
  3. package/front_end/core/sdk/CSSMatchedStyles.ts +3 -1
  4. package/front_end/core/sdk/CSSMetadata.ts +1 -0
  5. package/front_end/core/sdk/CSSPropertyParserMatchers.ts +65 -0
  6. package/front_end/generated/InspectorBackendCommands.ts +3 -2
  7. package/front_end/generated/SupportedCSSProperties.js +533 -19
  8. package/front_end/generated/protocol.ts +26 -4
  9. package/front_end/models/ai_assistance/agents/AiAgent.ts +8 -1
  10. package/front_end/models/ai_assistance/agents/PerformanceAgent.ts +7 -0
  11. package/front_end/models/extensions/ExtensionAPI.ts +47 -21
  12. package/front_end/models/javascript_metadata/NativeFunctions.js +5 -1
  13. package/front_end/panels/ai_assistance/AiAssistancePanel.ts +39 -1
  14. package/front_end/panels/ai_assistance/ai_assistance.ts +1 -0
  15. package/front_end/panels/ai_assistance/components/AIv2MarkdownRenderer.ts +228 -0
  16. package/front_end/panels/ai_assistance/components/ChatMessage.ts +39 -2
  17. package/front_end/panels/application/ApplicationPanelSidebar.ts +4 -0
  18. package/front_end/panels/application/CookieItemsView.ts +55 -6
  19. package/front_end/panels/application/DOMStorageItemsView.ts +43 -8
  20. package/front_end/panels/application/KeyValueStorageItemsView.ts +17 -9
  21. package/front_end/panels/elements/StylePropertyTreeElement.ts +73 -16
  22. package/front_end/panels/elements/StylesAiCodeCompletionProvider.ts +9 -1
  23. package/front_end/panels/elements/StylesSidebarPane.ts +22 -8
  24. package/front_end/panels/layer_viewer/PaintProfilerView.ts +309 -182
  25. package/front_end/panels/layer_viewer/paintProfiler.css +27 -23
  26. package/front_end/panels/layers/LayerPaintProfilerView.ts +86 -29
  27. package/front_end/panels/sources/WatchExpressionsSidebarPane.ts +210 -356
  28. package/front_end/panels/sources/watchExpressionsSidebarPane.css +7 -0
  29. package/front_end/panels/timeline/TimelinePaintProfilerView.ts +5 -5
  30. package/front_end/panels/timeline/components/NetworkTrackWidget.ts +122 -0
  31. package/front_end/panels/timeline/components/components.ts +2 -0
  32. package/front_end/panels/timeline/components/networkTrackWidget.css +31 -0
  33. package/front_end/panels/timeline/timeline.ts +2 -0
  34. package/front_end/third_party/chromium/README.chromium +1 -1
  35. package/front_end/ui/components/buttons/FloatingButton.ts +17 -2
  36. package/front_end/ui/components/buttons/floatingButton.css +2 -2
  37. package/front_end/ui/components/text_editor/AiCodeCompletionProvider.ts +1 -1
  38. package/front_end/ui/legacy/TextPrompt.ts +24 -18
  39. package/front_end/ui/legacy/Treeoutline.ts +31 -4
  40. package/front_end/ui/legacy/components/cookie_table/CookiesTable.ts +50 -24
  41. package/front_end/ui/visual_logging/KnownContextValues.ts +5 -0
  42. package/package.json +1 -1
@@ -50,8 +50,6 @@ import dataGridAiButtonStyles from '../data_grid/dataGridAiButton.css.js';
50
50
 
51
51
  import cookiesTableStyles from './cookiesTable.css.js';
52
52
 
53
- const STORAGE_FLOATING_BUTTON_ACTION_ID = 'ai-assistance.storage-floating-button';
54
-
55
53
  export interface ViewInput {
56
54
  data: CookieData[];
57
55
  selectedKey?: string;
@@ -176,6 +174,10 @@ const UIStrings = {
176
174
  * @description Text to be show in the Partition Key column in case it is an opaque origin.
177
175
  */
178
176
  opaquePartitionKey: '(opaque)',
177
+ /**
178
+ * @description Tooltip for the disabled AI button on HttpOnly cookies, explaining why they cannot be debugged.
179
+ */
180
+ httpOnlyCookiesCannotBeAdded: 'HttpOnly cookies cannot be added as context',
179
181
  } as const;
180
182
  const str_ = i18n.i18n.registerUIStrings('ui/legacy/components/cookie_table/CookiesTable.ts', UIStrings);
181
183
  const i18nString = i18n.i18n.getLocalizedString.bind(undefined, str_);
@@ -194,6 +196,10 @@ export class CookiesTable extends UI.Widget.VBox {
194
196
  #refreshCallback?: (() => void);
195
197
  #selectedCallback?: ((arg0: SDK.Cookie.Cookie|null) => void);
196
198
  #deleteCallback?: ((arg0: SDK.Cookie.Cookie, arg1: () => void) => void);
199
+ #aiButtonIsEnabled = false;
200
+ #onAiButtonClick?: (cookie: SDK.Cookie.Cookie, event: Event) => void;
201
+ #onPopulateAiContextMenu?: (cookie: SDK.Cookie.Cookie, contextMenu: UI.ContextMenu.ContextMenu) => void;
202
+ #aiButtonTitle?: string;
197
203
  private lastEditedColumnId: string|null;
198
204
  private data: CookieData[] = [];
199
205
  private cookies: SDK.Cookie.Cookie[] = [];
@@ -273,7 +279,9 @@ export class CookiesTable extends UI.Widget.VBox {
273
279
  SourcePort
274
280
  </th>` : ''}
275
281
  </tr>
276
- ${repeat(this.data, cookie => cookie.key, cookie => html`
282
+ ${repeat(this.data, cookie => cookie.key, cookie => {
283
+ const isHttpOnly = cookie['http-only'] === 'true';
284
+ return html`
277
285
  <tr ?selected=${cookie.key === input.selectedKey}
278
286
  ?inactive=${cookie.inactive}
279
287
  ?dirty=${cookie.dirty}
@@ -283,12 +291,13 @@ export class CookiesTable extends UI.Widget.VBox {
283
291
  @delete=${()=> input.onDelete(cookie)}
284
292
  @contextmenu=${(e: CustomEvent<UI.ContextMenu.ContextMenu>) => input.onContextMenu(cookie, e.detail)}
285
293
  @select=${() => input.onSelect(cookie.key)}>
286
- <td>${input.showAiButton && !Boolean(cookie['http-only']) ? html`
294
+ <td>${input.showAiButton ? html`
287
295
  <span class="ai-button-container">
288
296
  <devtools-floating-button
289
297
  icon-name=${Root.Runtime.hostConfig.devToolsGeminiRebranding?.enabled ? 'spark' : 'smart-assistant'}
290
- title=${ifDefined(input.aiButtonTitle)}
291
- @click=${(e: Event) => input.onAiButtonClick?.(cookie, e)}
298
+ title=${ifDefined(isHttpOnly ? i18nString(UIStrings.httpOnlyCookiesCannotBeAdded) : input.aiButtonTitle)}
299
+ ?disabled=${isHttpOnly}
300
+ @click=${(e: Event) => !isHttpOnly && input.onAiButtonClick?.(cookie, e)}
292
301
  ></devtools-floating-button>
293
302
  </span>
294
303
  ` : nothing}${cookie.icons?.name}${cookie.name}</td>
@@ -297,7 +306,7 @@ export class CookiesTable extends UI.Widget.VBox {
297
306
  <td>${cookie.icons?.path}${cookie.path}</td>
298
307
  <td title=${ifDefined(cookie.expiresTooltip)}>${cookie.expires}</td>
299
308
  <td>${cookie.size}</td>
300
- <td data-value=${Boolean(cookie['http-only'])}></td>
309
+ <td data-value=${isHttpOnly}></td>
301
310
  <td data-value=${Boolean(cookie.secure)}>${cookie.icons?.secure}</td>
302
311
  <td>${cookie.icons?.['same-site']}${cookie['same-site']}</td>
303
312
  <td>${cookie['partition-key-site']}</td>
@@ -307,7 +316,8 @@ export class CookiesTable extends UI.Widget.VBox {
307
316
  <td title=${i18nString(UIStrings.sourceSchemeTooltip)}>${cookie['source-scheme']}</td>` : ''}
308
317
  ${input.portBindingEnabled ? html`
309
318
  <td title=${i18nString(UIStrings.sourcePortTooltip)}>${cookie['source-port']}</td>` : ''}
310
- </tr>`)}
319
+ </tr>`;
320
+ })}
311
321
  ${input.editable ? html`<tr placeholder><tr>` : ''}
312
322
  </table>
313
323
  </devtools-data-grid>`, target, {host: target});
@@ -363,6 +373,26 @@ export class CookiesTable extends UI.Widget.VBox {
363
373
  this.#selectedCallback = callback;
364
374
  }
365
375
 
376
+ set aiButtonIsEnabled(enabled: boolean) {
377
+ this.#aiButtonIsEnabled = enabled;
378
+ }
379
+
380
+ get aiButtonIsEnabled(): boolean {
381
+ return this.#aiButtonIsEnabled;
382
+ }
383
+
384
+ set onAiButtonClick(callback: (cookie: SDK.Cookie.Cookie, event: Event) => void) {
385
+ this.#onAiButtonClick = callback;
386
+ }
387
+
388
+ set onPopulateAiContextMenu(callback: (cookie: SDK.Cookie.Cookie, contextMenu: UI.ContextMenu.ContextMenu) => void) {
389
+ this.#onPopulateAiContextMenu = callback;
390
+ }
391
+
392
+ set aiButtonTitle(title: string|undefined) {
393
+ this.#aiButtonTitle = title;
394
+ }
395
+
366
396
  set deleteCallback(callback: (arg0: SDK.Cookie.Cookie, arg1: () => void) => void) {
367
397
  this.#deleteCallback = callback;
368
398
  }
@@ -407,6 +437,7 @@ export class CookiesTable extends UI.Widget.VBox {
407
437
  }
408
438
 
409
439
  override performUpdate(): void {
440
+ const onAiButtonClick = this.#onAiButtonClick;
410
441
  const input: ViewInput = {
411
442
  data: this.data,
412
443
  selectedKey: this.selectedKey,
@@ -420,19 +451,17 @@ export class CookiesTable extends UI.Widget.VBox {
420
451
  onDelete: this.onDeleteCookie.bind(this),
421
452
  onSelect: this.onSelect.bind(this),
422
453
  onContextMenu: this.populateContextMenu.bind(this),
423
- showAiButton: this.isAiButtonEnabled(),
424
- aiButtonTitle: this.isAiButtonEnabled() &&
425
- UI.ActionRegistry.ActionRegistry.instance().hasAction(STORAGE_FLOATING_BUTTON_ACTION_ID) ?
426
- UI.ActionRegistry.ActionRegistry.instance().getAction(STORAGE_FLOATING_BUTTON_ACTION_ID).title() :
454
+ showAiButton: this.#aiButtonIsEnabled,
455
+ aiButtonTitle: this.#aiButtonIsEnabled ? this.#aiButtonTitle : undefined,
456
+ onAiButtonClick: (this.#aiButtonIsEnabled && onAiButtonClick) ?
457
+ (cookieData: CookieData, event: Event) => {
458
+ event.stopPropagation();
459
+ const cookie = this.cookies.find(c => c.key() === cookieData.key);
460
+ if (cookie) {
461
+ onAiButtonClick(cookie, event);
462
+ }
463
+ } :
427
464
  undefined,
428
- onAiButtonClick: (cookie: CookieData, event: Event) => {
429
- event.stopPropagation();
430
- this.onSelect(cookie.key);
431
- const actionRegistry = UI.ActionRegistry.ActionRegistry.instance();
432
- if (actionRegistry.hasAction(STORAGE_FLOATING_BUTTON_ACTION_ID)) {
433
- void actionRegistry.getAction(STORAGE_FLOATING_BUTTON_ACTION_ID).execute();
434
- }
435
- },
436
465
  };
437
466
  const output = {};
438
467
  this.view(input, output, this.element);
@@ -443,10 +472,6 @@ export class CookiesTable extends UI.Widget.VBox {
443
472
  this.#selectedCallback?.(this.selectedCookie());
444
473
  }
445
474
 
446
- private isAiButtonEnabled(): boolean {
447
- return UI.ActionRegistry.ActionRegistry.instance().hasAction(STORAGE_FLOATING_BUTTON_ACTION_ID);
448
- }
449
-
450
475
  private onDeleteCookie(data: CookieData): void {
451
476
  const cookie = this.cookies.find(cookie => cookie.key() === data.key);
452
477
  if (cookie && this.#deleteCallback) {
@@ -648,6 +673,7 @@ export class CookiesTable extends UI.Widget.VBox {
648
673
  return;
649
674
  }
650
675
  const cookie = maybeCookie;
676
+ this.#onPopulateAiContextMenu?.(cookie, contextMenu);
651
677
 
652
678
  contextMenu.revealSection().appendItem(i18nString(UIStrings.showRequestsWithThisCookie), () => {
653
679
  const requestFilter = NetworkForward.UIFilter.UIRequestFilter.filters([
@@ -17,8 +17,11 @@ export const knownContextValues = new Set([
17
17
  '%',
18
18
  '*',
19
19
  '-alternative-animation-with-timeline',
20
+ '-alternative-line-clamp-shorthand',
20
21
  '-alternative-position-try',
21
22
  '-alternative-webkit-line-clamp',
23
+ '-alternative-webkit-line-clamp-longhand',
24
+ '-alternative-webkit-line-clamp-shorthand',
22
25
  '-epub-caption-side',
23
26
  '-epub-text-combine',
24
27
  '-epub-text-emphasis',
@@ -2836,6 +2839,7 @@ export const knownContextValues = new Set([
2836
2839
  'network-show-blocked-cookies-only-setting',
2837
2840
  'network-show-settings-toolbar',
2838
2841
  'network-text-filter',
2842
+ 'network-track-widget',
2839
2843
  'network-web-socket-message-filter',
2840
2844
  'network.ad-blocking-enabled',
2841
2845
  'network.ad-blocking-enabled-true',
@@ -3163,6 +3167,7 @@ export const knownContextValues = new Set([
3163
3167
  'profile-view.focus-selected-function',
3164
3168
  'profile-view.restore-all-functions',
3165
3169
  'profile-view.selected-view',
3170
+ 'profiler',
3166
3171
  'profiler.clear-all',
3167
3172
  'profiler.delete-profile',
3168
3173
  'profiler.heap-snapshot-base',
package/package.json CHANGED
@@ -92,5 +92,5 @@
92
92
  "webidl2": "24.5.0",
93
93
  "yargs": "17.7.2"
94
94
  },
95
- "version": "1.0.1646714"
95
+ "version": "1.0.1649421"
96
96
  }