chrome-devtools-frontend 1.0.1529904 → 1.0.1530564

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 (122) hide show
  1. package/eslint.config.mjs +1 -1
  2. package/front_end/core/common/Worker.ts +10 -2
  3. package/front_end/core/host/AidaClient.ts +3 -3
  4. package/front_end/core/host/InspectorFrontendHostAPI.ts +1 -2
  5. package/front_end/core/sdk/NetworkManager.ts +25 -1
  6. package/front_end/entrypoints/main/main-meta.ts +2 -0
  7. package/front_end/entrypoints/trace_app/trace_app.ts +1 -0
  8. package/front_end/generated/SupportedCSSProperties.js +7 -0
  9. package/front_end/models/ai_assistance/performance/AICallTree.ts +2 -3
  10. package/front_end/models/ai_code_completion/AiCodeCompletion.ts +3 -3
  11. package/front_end/models/formatter/FormatterWorkerPool.ts +17 -1
  12. package/front_end/models/javascript_metadata/NativeFunctions.js +1 -1
  13. package/front_end/models/trace/ModelImpl.ts +8 -3
  14. package/front_end/models/trace/handlers/MetaHandler.ts +9 -1
  15. package/front_end/models/trace/types/Configuration.ts +1 -0
  16. package/front_end/panels/browser_debugger/browser_debugger-meta.ts +2 -1
  17. package/front_end/panels/changes/CombinedDiffView.ts +1 -2
  18. package/front_end/panels/console/ConsoleInsightTeaser.ts +19 -9
  19. package/front_end/panels/console/ConsolePrompt.ts +1 -1
  20. package/front_end/panels/console/ConsoleViewMessage.ts +7 -5
  21. package/front_end/panels/console/consoleInsightTeaser.css +0 -4
  22. package/front_end/panels/elements/ElementsTreeOutline.ts +1 -2
  23. package/front_end/panels/mobile_throttling/NetworkThrottlingSelector.ts +137 -37
  24. package/front_end/panels/mobile_throttling/ThrottlingPresets.ts +1 -1
  25. package/front_end/panels/sources/AiCodeCompletionPlugin.ts +1 -1
  26. package/front_end/panels/sources/SourcesPanel.ts +5 -0
  27. package/front_end/panels/sources/sources-meta.ts +13 -12
  28. package/front_end/panels/sources/sourcesView.css +1 -0
  29. package/front_end/panels/timeline/TimelinePanel.ts +1 -0
  30. package/front_end/panels/timeline/TimelineSelectorStatsView.ts +1 -2
  31. package/front_end/panels/timeline/TimelineTreeView.ts +3 -3
  32. package/front_end/panels/timeline/TimelineUIUtils.ts +16 -16
  33. package/front_end/services/tracing/FreshRecording.ts +4 -0
  34. package/front_end/third_party/chromium/README.chromium +1 -1
  35. package/front_end/third_party/puppeteer/README.chromium +2 -2
  36. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/core/Realm.d.ts +2 -2
  37. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/Accessibility.js +16 -0
  38. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/Accessibility.js.map +1 -1
  39. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/Browser.d.ts +2 -2
  40. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/Browser.d.ts.map +1 -1
  41. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/Browser.js +9 -4
  42. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/Browser.js.map +1 -1
  43. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/BrowserConnector.d.ts.map +1 -1
  44. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/BrowserConnector.js +2 -2
  45. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/BrowserConnector.js.map +1 -1
  46. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/ConnectOptions.d.ts +7 -0
  47. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/ConnectOptions.d.ts.map +1 -1
  48. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/util.js +1 -1
  49. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/util.js.map +1 -1
  50. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/injected/injected.d.ts +1 -1
  51. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/node/BrowserLauncher.d.ts.map +1 -1
  52. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/node/BrowserLauncher.js +12 -5
  53. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/node/BrowserLauncher.js.map +1 -1
  54. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/node/NodeWebSocketTransport.js +1 -1
  55. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/node/NodeWebSocketTransport.js.map +1 -1
  56. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/revisions.d.ts +3 -3
  57. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/revisions.js +3 -3
  58. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/revisions.js.map +1 -1
  59. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/util/Mutex.d.ts +2 -2
  60. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/util/version.d.ts +7 -0
  61. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/util/version.d.ts.map +1 -0
  62. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/util/version.js +13 -0
  63. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/util/version.js.map +1 -0
  64. package/front_end/third_party/puppeteer/package/lib/es5-iife/puppeteer-core-browser.d.ts +7 -0
  65. package/front_end/third_party/puppeteer/package/lib/es5-iife/puppeteer-core-browser.js +40 -14
  66. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/Accessibility.js +16 -0
  67. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/Accessibility.js.map +1 -1
  68. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/Browser.d.ts +2 -2
  69. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/Browser.d.ts.map +1 -1
  70. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/Browser.js +9 -4
  71. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/Browser.js.map +1 -1
  72. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/BrowserConnector.d.ts.map +1 -1
  73. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/BrowserConnector.js +2 -2
  74. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/BrowserConnector.js.map +1 -1
  75. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/ConnectOptions.d.ts +7 -0
  76. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/ConnectOptions.d.ts.map +1 -1
  77. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/util.js +1 -1
  78. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/util.js.map +1 -1
  79. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/node/BrowserLauncher.d.ts.map +1 -1
  80. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/node/BrowserLauncher.js +12 -5
  81. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/node/BrowserLauncher.js.map +1 -1
  82. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/node/NodeWebSocketTransport.js +1 -1
  83. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/node/NodeWebSocketTransport.js.map +1 -1
  84. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/revisions.d.ts +3 -3
  85. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/revisions.js +3 -3
  86. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/revisions.js.map +1 -1
  87. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/util/version.d.ts +7 -0
  88. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/util/version.d.ts.map +1 -0
  89. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/util/version.js +10 -0
  90. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/util/version.js.map +1 -0
  91. package/front_end/third_party/puppeteer/package/lib/types.d.ts +7 -0
  92. package/front_end/third_party/puppeteer/package/package.json +4 -4
  93. package/front_end/third_party/puppeteer/package/src/cdp/Accessibility.ts +18 -0
  94. package/front_end/third_party/puppeteer/package/src/cdp/Browser.ts +9 -1
  95. package/front_end/third_party/puppeteer/package/src/cdp/BrowserConnector.ts +2 -0
  96. package/front_end/third_party/puppeteer/package/src/common/ConnectOptions.ts +8 -0
  97. package/front_end/third_party/puppeteer/package/src/common/util.ts +1 -1
  98. package/front_end/third_party/puppeteer/package/src/node/BrowserLauncher.ts +16 -5
  99. package/front_end/third_party/puppeteer/package/src/node/NodeWebSocketTransport.ts +1 -1
  100. package/front_end/third_party/puppeteer/package/src/revisions.ts +3 -3
  101. package/front_end/third_party/puppeteer/package/src/util/version.ts +10 -0
  102. package/front_end/third_party/puppeteer/puppeteer-tsconfig.json +1 -1
  103. package/front_end/ui/components/icon_button/Icon.docs.ts +78 -0
  104. package/front_end/ui/components/markdown_view/CodeBlock.ts +2 -2
  105. package/front_end/ui/components/text_editor/config.ts +3 -3
  106. package/front_end/ui/components/tooltips/Tooltip.ts +9 -4
  107. package/front_end/ui/legacy/UIUtils.ts +12 -0
  108. package/front_end/ui/visual_logging/KnownContextValues.ts +1 -0
  109. package/package.json +1 -1
  110. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/generated/version.d.ts +0 -5
  111. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/generated/version.d.ts.map +0 -1
  112. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/generated/version.js +0 -8
  113. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/generated/version.js.map +0 -1
  114. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/generated/version.d.ts +0 -5
  115. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/generated/version.d.ts.map +0 -1
  116. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/generated/version.js +0 -5
  117. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/generated/version.js.map +0 -1
  118. package/front_end/third_party/puppeteer/package/src/generated/version.ts +0 -4
  119. package/front_end/ui/components/copy_to_clipboard/copyToClipboard.ts +0 -19
  120. package/front_end/ui/components/copy_to_clipboard/copy_to_clipboard.ts +0 -5
  121. package/front_end/ui/components/docs/icon_component/basic.html +0 -40
  122. package/front_end/ui/components/docs/icon_component/basic.ts +0 -68
package/eslint.config.mjs CHANGED
@@ -810,7 +810,7 @@ export default defineConfig([
810
810
  },
811
811
  {
812
812
  name: 'Front-end component docs',
813
- files: ['front_end/ui/components/docs/**/*.ts'],
813
+ files: ['front_end/ui/components/docs/**/*.ts', '**/*.docs.ts'],
814
814
  rules: {
815
815
  // This makes the component doc examples very verbose and doesn't add
816
816
  // anything, so we leave return types to the developer within the
@@ -5,10 +5,15 @@
5
5
  export class WorkerWrapper {
6
6
  readonly #workerPromise: Promise<Worker>;
7
7
  #disposed?: boolean;
8
+ #rejectWorkerPromise?: (error: Error) => void;
8
9
 
9
10
  private constructor(workerLocation: URL) {
10
- this.#workerPromise = new Promise(fulfill => {
11
+ this.#workerPromise = new Promise((fulfill, reject) => {
12
+ this.#rejectWorkerPromise = reject;
11
13
  const worker = new Worker(workerLocation, {type: 'module'});
14
+ worker.onerror = event => {
15
+ console.error(`Failed to load worker for ${workerLocation.href}:`, event);
16
+ };
12
17
  worker.onmessage = (event: MessageEvent<unknown>) => {
13
18
  console.assert(event.data === 'workerReady');
14
19
  worker.onmessage = null;
@@ -34,7 +39,10 @@ export class WorkerWrapper {
34
39
  void this.#workerPromise.then(worker => worker.terminate());
35
40
  }
36
41
 
37
- terminate(): void {
42
+ terminate(immediately = false): void {
43
+ if (immediately) {
44
+ this.#rejectWorkerPromise?.(new Error('Worker terminated'));
45
+ }
38
46
  this.dispose();
39
47
  }
40
48
 
@@ -279,7 +279,7 @@ export interface DoConversationClientEvent {
279
279
 
280
280
  export interface UserImpression {
281
281
  sample: {
282
- sample_id: number,
282
+ sample_id?: number,
283
283
  };
284
284
  latency: {
285
285
  duration: {
@@ -291,7 +291,7 @@ export interface UserImpression {
291
291
 
292
292
  export interface UserAcceptance {
293
293
  sample: {
294
- sample_id: number,
294
+ sample_id?: number,
295
295
  };
296
296
  }
297
297
 
@@ -366,7 +366,7 @@ export interface CompletionResponse {
366
366
  export interface GenerationSample {
367
367
  generationString: string;
368
368
  score: number;
369
- sampleId: number;
369
+ sampleId?: number;
370
370
  attributionMetadata?: AttributionMetadata;
371
371
  }
372
372
 
@@ -346,8 +346,7 @@ export interface InspectorFrontendHostAPI {
346
346
  closeWindow(): void;
347
347
 
348
348
  /**
349
- * Don't use directly - use {@link CopyToClipboard.copyTextToClipboard} instead.
350
- * @deprecated Marked to restrict usage.
349
+ * If you need to alert to the user after copying use {@link UIUtils.copyTextToClipboard}.
351
350
  */
352
351
  copyText(text: string|null|undefined): void;
353
352
 
@@ -67,6 +67,10 @@ const UIStrings = {
67
67
  * @description Text in Network Manager representing the "Fast 4G" throttling preset
68
68
  */
69
69
  fast4G: 'Fast 4G',
70
+ /**
71
+ * @description Text in Network Manager representing the "Blocking" throttling preset
72
+ */
73
+ block: 'Block',
70
74
  /**
71
75
  * @description Text in Network Manager
72
76
  * @example {https://example.com} PH1
@@ -459,6 +463,12 @@ export interface EventTypes {
459
463
  * @see https://crbug.com/342406608#comment10 for context around the addition of 4G presets in June 2024.
460
464
  */
461
465
 
466
+ export const BlockingConditions: ThrottlingConditions = {
467
+ key: PredefinedThrottlingConditionKey.BLOCKING,
468
+ block: true,
469
+ title: i18nLazyString(UIStrings.block),
470
+ };
471
+
462
472
  export const NoThrottlingConditions: Conditions = {
463
473
  key: PredefinedThrottlingConditionKey.NO_THROTTLING,
464
474
  title: i18nLazyString(UIStrings.noThrottling),
@@ -2466,7 +2476,15 @@ class ExtraInfoBuilder {
2466
2476
 
2467
2477
  SDKModel.register(NetworkManager, {capabilities: Capability.NETWORK, autostart: true});
2468
2478
 
2469
- export function networkConditionsEqual(first: Conditions, second: Conditions): boolean {
2479
+ export function networkConditionsEqual(first: ThrottlingConditions, second: ThrottlingConditions): boolean {
2480
+ if ('block' in first || 'block' in second) {
2481
+ if ('block' in first && 'block' in second) {
2482
+ const firstTitle = (typeof first.title === 'function' ? first.title() : first.title);
2483
+ const secondTitle = (typeof second.title === 'function' ? second.title() : second.title);
2484
+ return firstTitle === secondTitle && first.block === second.block;
2485
+ }
2486
+ return false;
2487
+ }
2470
2488
  // Caution: titles might be different function instances, which produce
2471
2489
  // the same value.
2472
2490
  // We prefer to use the i18nTitleKey to prevent against locale changes or
@@ -2493,6 +2511,7 @@ export function networkConditionsEqual(first: Conditions, second: Conditions): b
2493
2511
  * please talk to jacktfranklin@ first.
2494
2512
  */
2495
2513
  export const enum PredefinedThrottlingConditionKey {
2514
+ BLOCKING = 'BLOCKING',
2496
2515
  NO_THROTTLING = 'NO_THROTTLING',
2497
2516
  OFFLINE = 'OFFLINE',
2498
2517
  SPEED_3G = 'SPEED_3G',
@@ -2525,6 +2544,11 @@ export function getPredefinedCondition(key: ThrottlingConditionKey): Conditions|
2525
2544
  return THROTTLING_CONDITIONS_LOOKUP.get(key) ?? null;
2526
2545
  }
2527
2546
 
2547
+ export type ThrottlingConditions = Conditions|{
2548
+ readonly key: ThrottlingConditionKey,
2549
+ block: true,
2550
+ title: string | (() => string),
2551
+ };
2528
2552
  export interface Conditions {
2529
2553
  readonly key: ThrottlingConditionKey;
2530
2554
  download: number;
@@ -6,6 +6,7 @@ import * as Common from '../../core/common/common.js';
6
6
  import * as Host from '../../core/host/host.js';
7
7
  import * as i18n from '../../core/i18n/i18n.js';
8
8
  import type * as Platform from '../../core/platform/platform.js';
9
+ import * as Root from '../../core/root/root.js';
9
10
  import * as SDK from '../../core/sdk/sdk.js';
10
11
  import * as Workspace from '../../models/workspace/workspace.js';
11
12
  import * as Components from '../../ui/legacy/components/utils/utils.js';
@@ -935,6 +936,7 @@ UI.Toolbar.registerToolbarItem({
935
936
  });
936
937
 
937
938
  UI.Toolbar.registerToolbarItem({
939
+ condition: () => !Root.Runtime.Runtime.isTraceApp(),
938
940
  async loadItem() {
939
941
  const Main = await loadMainModule();
940
942
  return Main.MainImpl.MainMenuItem.instance();
@@ -18,6 +18,7 @@ import '../../panels/sources/sources-meta.js';
18
18
  // sdk/emulation depends on panels/sensors: crbug.com/1376652
19
19
  import '../../panels/sensors/sensors-meta.js';
20
20
  import '../../panels/timeline/timeline-meta.js';
21
+ import '../../panels/ai_assistance/ai_assistance-meta.js';
21
22
  import '../../ui/legacy/components/perf_ui/perf_ui-meta.js';
22
23
  import '../../ui/legacy/components/quick_open/quick_open-meta.js';
23
24
  import '../../ui/legacy/components/source_frame/source_frame-meta.js';
@@ -3773,6 +3773,13 @@ export const generatedProperties = [
3773
3773
  ],
3774
3774
  "name": "rule-color"
3775
3775
  },
3776
+ {
3777
+ "longhands": [
3778
+ "row-rule-outset",
3779
+ "column-rule-outset"
3780
+ ],
3781
+ "name": "rule-outset"
3782
+ },
3776
3783
  {
3777
3784
  "longhands": [
3778
3785
  "column-rule-style",
@@ -2,7 +2,6 @@
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
- import * as Root from '../../../core/root/root.js';
6
5
  import * as Trace from '../../../models/trace/trace.js';
7
6
  import * as SourceMapsResolver from '../../../models/trace_source_maps_resolver/trace_source_maps_resolver.js';
8
7
 
@@ -144,7 +143,7 @@ export class AICallTree {
144
143
  return null;
145
144
  }
146
145
 
147
- const allEventsEnabled = Root.Runtime.experiments.isEnabled('timeline-show-all-events');
146
+ const showAllEvents = parsedTrace.data.Meta.config.showAllEvents;
148
147
  const {startTime, endTime} = Trace.Helpers.Timing.eventTimingsMilliSeconds(selectedEvent);
149
148
  const selectedEventBounds = Trace.Helpers.Timing.traceWindowFromMicroSeconds(
150
149
  Trace.Helpers.Timing.milliToMicro(startTime), Trace.Helpers.Timing.milliToMicro(endTime));
@@ -166,7 +165,7 @@ export class AICallTree {
166
165
  // If the "Show all events" experiment is on, we don't filter out any
167
166
  // events here, otherwise the generated call tree will not match what the
168
167
  // user is seeing.
169
- if (!allEventsEnabled) {
168
+ if (!showAllEvents) {
170
169
  filters.push(new Trace.Extras.TraceFilter.VisibleEventsFilter(Trace.Styles.visibleTypes()));
171
170
  }
172
171
 
@@ -257,10 +257,10 @@ export class AiCodeCompletion extends Common.ObjectWrapper.ObjectWrapper<EventTy
257
257
 
258
258
  async #generateSampleForRequest(request: Host.AidaClient.CompletionRequest, cursor: number): Promise<{
259
259
  suggestionText: string,
260
- sampleId: number,
261
260
  fromCache: boolean,
262
261
  citations: Host.AidaClient.Citation[],
263
262
  rpcGlobalId?: Host.AidaClient.RpcGlobalId,
263
+ sampleId?: number,
264
264
  }|null> {
265
265
  const {response, fromCache} = await this.#completeCodeCached(request);
266
266
  debugLog('At cursor position', cursor, {request, response, fromCache});
@@ -417,7 +417,7 @@ export class AiCodeCompletion extends Common.ObjectWrapper.ObjectWrapper<EventTy
417
417
  this.#aidaRequestCache = {request, response};
418
418
  }
419
419
 
420
- #registerUserImpression(rpcGlobalId: Host.AidaClient.RpcGlobalId, sampleId: number, latency: number): void {
420
+ #registerUserImpression(rpcGlobalId: Host.AidaClient.RpcGlobalId, latency: number, sampleId?: number): void {
421
421
  const seconds = Math.floor(latency / 1_000);
422
422
  const remainingMs = latency % 1_000;
423
423
  const nanos = Math.floor(remainingMs * 1_000_000);
@@ -443,7 +443,7 @@ export class AiCodeCompletion extends Common.ObjectWrapper.ObjectWrapper<EventTy
443
443
  Host.userMetrics.actionTaken(Host.UserMetrics.Action.AiCodeCompletionSuggestionDisplayed);
444
444
  }
445
445
 
446
- registerUserAcceptance(rpcGlobalId: Host.AidaClient.RpcGlobalId, sampleId: number): void {
446
+ registerUserAcceptance(rpcGlobalId: Host.AidaClient.RpcGlobalId, sampleId?: number): void {
447
447
  void this.#aidaClient.registerClientEvent({
448
448
  corresponding_aida_rpc_global_id: rpcGlobalId,
449
449
  disable_user_content_logging: true,
@@ -7,7 +7,7 @@ import * as FormatterActions from '../../entrypoints/formatter_worker/FormatterA
7
7
 
8
8
  export {DefinitionKind, ScopeKind, type ScopeTreeNode} from '../../entrypoints/formatter_worker/FormatterActions.js';
9
9
 
10
- let formatterWorkerPoolInstance: FormatterWorkerPool;
10
+ let formatterWorkerPoolInstance: FormatterWorkerPool|undefined;
11
11
 
12
12
  export class FormatterWorkerPool {
13
13
  private taskQueue: Task[];
@@ -26,6 +26,22 @@ export class FormatterWorkerPool {
26
26
  return formatterWorkerPoolInstance;
27
27
  }
28
28
 
29
+ dispose(): void {
30
+ for (const task of this.taskQueue) {
31
+ console.error('rejecting task');
32
+ task.errorCallback(new Event('Worker terminated'));
33
+ }
34
+ for (const [worker, task] of this.workerTasks.entries()) {
35
+ task?.errorCallback(new Event('Worker terminated'));
36
+ worker.terminate(/* immediately=*/ true);
37
+ }
38
+ }
39
+
40
+ static removeInstance(): void {
41
+ formatterWorkerPoolInstance?.dispose();
42
+ formatterWorkerPoolInstance = undefined;
43
+ }
44
+
29
45
  private createWorker(): Common.Worker.WorkerWrapper {
30
46
  const worker = Common.Worker.WorkerWrapper.fromURL(
31
47
  new URL('../../entrypoints/formatter_worker/formatter_worker-entrypoint.js', import.meta.url));
@@ -687,7 +687,7 @@ export const NativeFunctions = [
687
687
  {
688
688
  name: "toJSON",
689
689
  signatures: [["?key"]],
690
- receivers: ["Date"]
690
+ receivers: ["Date","CSPViolationReportBody","ReportBody","CoopAccessViolationReportBody","DeprecationReportBody","DocumentPolicyViolationReportBody","IntegrityViolationReportBody","InterventionReportBody","PermissionsPolicyViolationReportBody","TestReportBody"]
691
691
  },
692
692
  {
693
693
  name: "parse",
@@ -81,8 +81,13 @@ export class Model extends EventTarget {
81
81
  * });
82
82
  * void this.traceModel.parse(events);
83
83
  **/
84
- async parse(traceEvents: readonly Types.Events.Event[], config?: Types.Configuration.ParseOptions): Promise<void> {
85
- const metadata = config?.metadata || {};
84
+ async parse(traceEvents: readonly Types.Events.Event[], config: Types.Configuration.ParseOptions = {}):
85
+ Promise<void> {
86
+ if (config.showAllEvents === undefined) {
87
+ config.showAllEvents = this.#config.showAllEvents;
88
+ }
89
+
90
+ const metadata = config.metadata || {};
86
91
  // During parsing, periodically update any listeners on each processors'
87
92
  // progress (if they have any updates).
88
93
  const onTraceUpdate = (event: Event): void => {
@@ -98,7 +103,7 @@ export class Model extends EventTarget {
98
103
  try {
99
104
  // Wait for all outstanding promises before finishing the async execution,
100
105
  // but perform all tasks in parallel.
101
- await this.#processor.parse(traceEvents, config ?? {});
106
+ await this.#processor.parse(traceEvents, config);
102
107
  if (!this.#processor.data) {
103
108
  throw new Error('processor did not parse trace');
104
109
  }
@@ -6,6 +6,10 @@ import * as Platform from '../../../core/platform/platform.js';
6
6
  import * as Helpers from '../helpers/helpers.js';
7
7
  import * as Types from '../types/types.js';
8
8
 
9
+ import type {FinalizeOptions} from './types.js';
10
+
11
+ let config: {showAllEvents: boolean};
12
+
9
13
  // We track the renderer processes we see in each frame on the way through the trace.
10
14
  let rendererProcessesByFrameId: FrameProcessData = new Map();
11
15
 
@@ -349,7 +353,9 @@ export function handleEvent(event: Types.Events.Event): void {
349
353
  }
350
354
  }
351
355
 
352
- export async function finalize(): Promise<void> {
356
+ export async function finalize(options?: FinalizeOptions): Promise<void> {
357
+ config = {showAllEvents: Boolean(options?.showAllEvents)};
358
+
353
359
  // We try to set the minimum time by finding the event with the smallest
354
360
  // timestamp. However, if we also got a timestamp from the
355
361
  // TracingStartedInBrowser event, we should always use that.
@@ -431,6 +437,7 @@ export async function finalize(): Promise<void> {
431
437
  }
432
438
 
433
439
  export interface MetaHandlerData {
440
+ config: {showAllEvents: boolean};
434
441
  traceIsGeneric: boolean;
435
442
  traceBounds: Types.Timing.TraceWindowMicro;
436
443
  browserProcessId: Types.Events.ProcessID;
@@ -494,6 +501,7 @@ export type FrameProcessData =
494
501
 
495
502
  export function data(): MetaHandlerData {
496
503
  return {
504
+ config,
497
505
  traceBounds,
498
506
  browserProcessId,
499
507
  browserThreadId,
@@ -66,6 +66,7 @@ export function configToCacheKey(config: Configuration): string {
66
66
  }
67
67
 
68
68
  export interface ParseOptions {
69
+ showAllEvents?: boolean;
69
70
  /**
70
71
  * If the trace was just recorded on the current page, rather than an imported file.
71
72
  * TODO(paulirish): Maybe remove. This is currently unused by the Processor and Handlers
@@ -215,6 +215,7 @@ UI.ViewManager.registerViewExtension({
215
215
  commandPrompt: i18nLazyString(UIStrings.showOverrides),
216
216
  order: 4,
217
217
  persistence: UI.ViewManager.ViewPersistence.PERMANENT,
218
+ condition: () => !Root.Runtime.Runtime.isTraceApp(),
218
219
  async loadView() {
219
220
  const Sources = await loadSourcesModule();
220
221
  return Sources.SourcesNavigator.OverridesNavigatorView.instance();
@@ -228,7 +229,7 @@ UI.ViewManager.registerViewExtension({
228
229
  commandPrompt: i18nLazyString(UIStrings.showContentScripts),
229
230
  order: 5,
230
231
  persistence: UI.ViewManager.ViewPersistence.PERMANENT,
231
- condition: () => Root.Runtime.getPathName() !== '/bundled/worker_app.html',
232
+ condition: () => Root.Runtime.getPathName() !== '/bundled/worker_app.html' && !Root.Runtime.Runtime.isTraceApp(),
232
233
  async loadView() {
233
234
  const Sources = await loadSourcesModule();
234
235
  return new Sources.SourcesNavigator.ContentScriptsNavigatorView();
@@ -10,7 +10,6 @@ import type * as Workspace from '../../models/workspace/workspace.js';
10
10
  import * as WorkspaceDiff from '../../models/workspace_diff/workspace_diff.js';
11
11
  import type * as Diff from '../../third_party/diff/diff.js';
12
12
  import * as Buttons from '../../ui/components/buttons/buttons.js';
13
- import * as CopyToClipboard from '../../ui/components/copy_to_clipboard/copy_to_clipboard.js';
14
13
  import type * as DiffView from '../../ui/components/diff_view/diff_view.js';
15
14
  import * as UI from '../../ui/legacy/legacy.js';
16
15
  import * as Lit from '../../ui/lit/lit.js';
@@ -168,7 +167,7 @@ export class CombinedDiffView extends UI.Widget.Widget {
168
167
  return;
169
168
  }
170
169
 
171
- CopyToClipboard.copyTextToClipboard(content.text, i18nString(UIStrings.copied));
170
+ UI.UIUtils.copyTextToClipboard(content.text, i18nString(UIStrings.copied));
172
171
  this.#copiedFiles[fileUrl] = true;
173
172
  this.requestUpdate();
174
173
  setTimeout(() => {
@@ -25,7 +25,11 @@ const UIStringsNotTranslate = {
25
25
  /**
26
26
  * @description Link text in the disclaimer dialog, linking to a settings page containing more information
27
27
  */
28
- learnMore: 'Learn more about AI summaries',
28
+ learnMore: 'Learn more',
29
+ /**
30
+ * @description Link text in the Console Insights Teaser info tooltip, linking to an explainer on how data is being used in this feature
31
+ */
32
+ learnMoreAboutAiSummaries: 'Learn more about AI summaries',
29
33
  /**
30
34
  * @description Description of the console insights feature
31
35
  */
@@ -69,6 +73,10 @@ const UIStringsNotTranslate = {
69
73
  * @description Label for a checkbox which turns off the teaser explanation feature
70
74
  */
71
75
  dontShow: 'Don’t show',
76
+ /**
77
+ * @description Aria-label for an infor-button triggering a tooltip with more info about data usage
78
+ */
79
+ learnDataUsage: 'Learn more about how your data is used',
72
80
  } as const;
73
81
 
74
82
  const lockedString = i18n.i18n.lockedString;
@@ -108,7 +116,7 @@ export const DEFAULT_VIEW = (input: ViewInput, _output: undefined, target: HTMLE
108
116
  >
109
117
  <div class="teaser-tooltip-container">
110
118
  ${showPlaceholder ? html`
111
- <h2 tabindex="-1">${lockedString(UIStringsNotTranslate.summarizing)}</h2>
119
+ <h2>${lockedString(UIStringsNotTranslate.summarizing)}</h2>
112
120
  <div
113
121
  role="presentation"
114
122
  aria-label=${lockedString(UIStringsNotTranslate.loading)}
@@ -126,7 +134,7 @@ export const DEFAULT_VIEW = (input: ViewInput, _output: undefined, target: HTMLE
126
134
  </svg>
127
135
  </div>
128
136
  ` : html`
129
- <h2 tabindex="-1">${input.headerText}</h2>
137
+ <h2>${input.headerText}</h2>
130
138
  <div>${input.mainText}</div>
131
139
  <div class="tooltip-footer">
132
140
  ${input.hasTellMeMoreButton ? html`
@@ -140,23 +148,25 @@ export const DEFAULT_VIEW = (input: ViewInput, _output: undefined, target: HTMLE
140
148
  ${lockedString(UIStringsNotTranslate.tellMeMore)}
141
149
  </devtools-button>
142
150
  ` : Lit.nothing}
143
- <devtools-icon
144
- name="info"
145
- class="info-icon"
151
+ <devtools-button
152
+ .iconName=${'info'}
153
+ .variant=${Buttons.Button.Variant.ICON}
146
154
  aria-details=${'teaser-info-tooltip-' + input.uuid}
147
- ></devtools-icon>
155
+ aria-label=${lockedString(UIStringsNotTranslate.learnDataUsage)}
156
+ ></devtools-button>
148
157
  <devtools-tooltip id=${'teaser-info-tooltip-' + input.uuid} variant="rich">
149
158
  <div class="info-tooltip-text">${lockedString(UIStringsNotTranslate.infoTooltipText)}</div>
150
159
  <div class="learn-more">
151
160
  <x-link
152
161
  class="devtools-link"
153
- title=${lockedString(UIStringsNotTranslate.learnMore)}
162
+ title=${lockedString(UIStringsNotTranslate.learnMoreAboutAiSummaries)}
154
163
  href=${DATA_USAGE_URL}
155
164
  jslog=${VisualLogging.link().track({click: true, keydown:'Enter|Space'}).context('explain.teaser.learn-more')}
156
- >${lockedString(UIStringsNotTranslate.learnMore)}</x-link>
165
+ >${lockedString(UIStringsNotTranslate.learnMoreAboutAiSummaries)}</x-link>
157
166
  </div>
158
167
  </devtools-tooltip>
159
168
  <devtools-checkbox
169
+ aria-label=${lockedString(UIStringsNotTranslate.dontShow)}
160
170
  @change=${input.dontShowChanged}
161
171
  jslog=${VisualLogging.toggle('explain.teaser.dont-show').track({ change: true })}>
162
172
  ${lockedString(UIStringsNotTranslate.dontShow)}
@@ -396,7 +396,7 @@ export class ConsolePrompt extends Common.ObjectWrapper.eventMixin<EventTypes, t
396
396
  if (accepted) {
397
397
  this.dispatchEventToListeners(
398
398
  Events.AI_CODE_COMPLETION_SUGGESTION_ACCEPTED, {citations: this.aiCodeCompletionCitations});
399
- if (suggestion?.rpcGlobalId && suggestion?.sampleId) {
399
+ if (suggestion?.rpcGlobalId) {
400
400
  this.aiCodeCompletion?.registerUserAcceptance(suggestion.rpcGlobalId, suggestion.sampleId);
401
401
  }
402
402
  }
@@ -380,7 +380,7 @@ export class ConsoleViewMessage implements ConsoleViewportElement {
380
380
  wasShown(): void {
381
381
  this.isVisibleInternal = true;
382
382
  if (this.elementInternal) {
383
- this.#teaser?.show(this.elementInternal);
383
+ this.#teaser?.show(this.elementInternal, this.consoleRowWrapper);
384
384
  }
385
385
  }
386
386
 
@@ -1343,14 +1343,14 @@ export class ConsoleViewMessage implements ConsoleViewportElement {
1343
1343
  return this.contentElementInternal;
1344
1344
  }
1345
1345
 
1346
- #onMouseEnter(_event: MouseEvent): void {
1346
+ #startTeaserGeneration(): void {
1347
1347
  if (this.#teaser &&
1348
1348
  Common.Settings.Settings.instance().moduleSetting('console-insight-teasers-enabled').getIfNotDisabled()) {
1349
1349
  this.#teaser.maybeGenerateTeaser();
1350
1350
  }
1351
1351
  }
1352
1352
 
1353
- #onMouseLeave(): void {
1353
+ #abortTeaserGeneration(): void {
1354
1354
  this.#teaser?.abortTeaserGeneration();
1355
1355
  }
1356
1356
 
@@ -1361,8 +1361,10 @@ export class ConsoleViewMessage implements ConsoleViewportElement {
1361
1361
  this.elementInternal = document.createElement('div');
1362
1362
  this.elementInternal.tabIndex = -1;
1363
1363
  this.elementInternal.addEventListener('keydown', (this.onKeyDown.bind(this) as EventListener));
1364
- this.elementInternal.addEventListener('mouseenter', this.#onMouseEnter.bind(this));
1365
- this.elementInternal.addEventListener('mouseleave', this.#onMouseLeave.bind(this));
1364
+ this.elementInternal.addEventListener('mouseenter', this.#startTeaserGeneration.bind(this));
1365
+ this.elementInternal.addEventListener('focusin', this.#startTeaserGeneration.bind(this));
1366
+ this.elementInternal.addEventListener('mouseleave', this.#abortTeaserGeneration.bind(this));
1367
+ this.elementInternal.addEventListener('focusout', this.#abortTeaserGeneration.bind(this));
1366
1368
  this.updateMessageElement();
1367
1369
  this.elementInternal.classList.toggle('console-adjacent-user-command-result', this.#adjacentUserCommandResult);
1368
1370
  return this.elementInternal;
@@ -72,10 +72,6 @@
72
72
  display: flex;
73
73
  align-items: center;
74
74
 
75
- .info-icon {
76
- margin-left: var(--sys-size-4);
77
- }
78
-
79
75
  devtools-checkbox {
80
76
  margin-left: auto;
81
77
  }
@@ -41,7 +41,6 @@ import * as Badges from '../../models/badges/badges.js';
41
41
  import * as Elements from '../../models/elements/elements.js';
42
42
  import * as IssuesManager from '../../models/issues_manager/issues_manager.js';
43
43
  import * as CodeHighlighter from '../../ui/components/code_highlighter/code_highlighter.js';
44
- import * as CopyToClipboard from '../../ui/components/copy_to_clipboard/copy_to_clipboard.js';
45
44
  import * as IssueCounter from '../../ui/components/issue_counter/issue_counter.js';
46
45
  import * as UI from '../../ui/legacy/legacy.js';
47
46
  import {html, nothing, render} from '../../ui/lit/lit.js';
@@ -736,7 +735,7 @@ export class ElementsTreeOutline extends
736
735
  }
737
736
  void node.getOuterHTML(includeShadowRoots).then(outerHTML => {
738
737
  if (outerHTML !== null) {
739
- CopyToClipboard.copyTextToClipboard(outerHTML);
738
+ UI.UIUtils.copyTextToClipboard(outerHTML);
740
739
  }
741
740
  });
742
741
  this.setClipboardData({node, isCut});