chrome-devtools-frontend 1.0.1581708 → 1.0.1583146

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 (73) hide show
  1. package/front_end/core/root/Runtime.ts +0 -5
  2. package/front_end/core/sdk/NetworkManager.ts +63 -115
  3. package/front_end/core/sdk/RemoteObject.ts +7 -1
  4. package/front_end/entrypoints/greendev_floaty/FloatyEntrypoint.ts +9 -24
  5. package/front_end/entrypoints/greendev_floaty/floaty.css +1 -1
  6. package/front_end/entrypoints/greendev_floaty/greendev_floaty.ts +1 -1
  7. package/front_end/generated/InspectorBackendCommands.ts +1 -1
  8. package/front_end/generated/SupportedCSSProperties.js +2 -0
  9. package/front_end/generated/protocol.ts +0 -6
  10. package/front_end/models/ai_assistance/agents/ContextSelectionAgent.snapshot.txt +6 -6
  11. package/front_end/models/ai_assistance/agents/ContextSelectionAgent.ts +17 -9
  12. package/front_end/models/ai_assistance/agents/NetworkAgent.ts +2 -6
  13. package/front_end/models/ai_assistance/data_formatters/NetworkRequestFormatter.ts +66 -2
  14. package/front_end/models/greendev/Prototypes.ts +1 -10
  15. package/front_end/models/issues_manager/ConnectionAllowlistIssue.ts +75 -0
  16. package/front_end/models/issues_manager/FederatedAuthRequestIssue.ts +0 -30
  17. package/front_end/models/issues_manager/IssuesManager.ts +5 -0
  18. package/front_end/models/issues_manager/descriptions/connectionAllowlistInvalidAllowlistItemType.md +12 -0
  19. package/front_end/models/issues_manager/descriptions/connectionAllowlistInvalidHeader.md +12 -0
  20. package/front_end/models/issues_manager/descriptions/connectionAllowlistInvalidUrlPattern.md +8 -0
  21. package/front_end/models/issues_manager/descriptions/connectionAllowlistItemNotInnerList.md +12 -0
  22. package/front_end/models/issues_manager/descriptions/connectionAllowlistMoreThanOneList.md +7 -0
  23. package/front_end/models/issues_manager/descriptions/connectionAllowlistReportingEndpointNotToken.md +10 -0
  24. package/front_end/models/issues_manager/issues_manager.ts +2 -0
  25. package/front_end/panels/ai_assistance/AiAssistancePanel.ts +22 -4
  26. package/front_end/panels/ai_assistance/components/ChatInput.ts +7 -3
  27. package/front_end/panels/ai_assistance/components/ChatMessage.ts +4 -2
  28. package/front_end/panels/application/preloading/PreloadingView.ts +8 -1
  29. package/front_end/panels/application/preloading/components/PreloadingDetailsReportView.ts +4 -1
  30. package/front_end/panels/application/preloading/components/PreloadingGrid.ts +2 -1
  31. package/front_end/panels/application/preloading/components/PreloadingString.ts +12 -3
  32. package/front_end/panels/application/preloading/helper/PreloadingForward.ts +14 -0
  33. package/front_end/panels/autofill/AutofillView.ts +4 -8
  34. package/front_end/panels/browser_debugger/CategorizedBreakpointsSidebarPane.ts +37 -3
  35. package/front_end/panels/changes/ChangesSidebar.ts +2 -6
  36. package/front_end/panels/common/AiCodeGenerationTeaser.ts +27 -8
  37. package/front_end/panels/console/ConsoleSidebar.ts +3 -11
  38. package/front_end/panels/elements/ComputedStyleWidget.ts +41 -29
  39. package/front_end/panels/elements/ElementStatePaneWidget.ts +1 -1
  40. package/front_end/panels/elements/ElementsTreeElement.ts +487 -426
  41. package/front_end/panels/elements/EventListenersWidget.ts +2 -4
  42. package/front_end/panels/elements/PropertiesWidget.ts +1 -2
  43. package/front_end/panels/elements/StylePropertyTreeElement.ts +18 -2
  44. package/front_end/panels/elements/computedStyleWidget.css +30 -0
  45. package/front_end/panels/lighthouse/LighthouseStartView.ts +3 -5
  46. package/front_end/panels/lighthouse/lighthouseStartView.css +6 -0
  47. package/front_end/panels/network/NetworkLogView.ts +67 -108
  48. package/front_end/panels/network/RequestConditionsDrawer.ts +40 -131
  49. package/front_end/panels/network/RequestInitiatorView.ts +19 -8
  50. package/front_end/panels/network/network-meta.ts +4 -27
  51. package/front_end/panels/settings/AISettingsTab.ts +1 -5
  52. package/front_end/panels/settings/SettingsScreen.ts +0 -51
  53. package/front_end/panels/settings/WorkspaceSettingsTab.ts +1 -1
  54. package/front_end/panels/sources/CallStackSidebarPane.ts +2 -2
  55. package/front_end/panels/timeline/AnimationsTrackAppender.ts +4 -1
  56. package/front_end/panels/timeline/InteractionsTrackAppender.ts +1 -1
  57. package/front_end/panels/timeline/TimelineUIUtils.ts +13 -16
  58. package/front_end/third_party/chromium/README.chromium +1 -1
  59. package/front_end/ui/components/markdown_view/MarkdownLinksMap.ts +5 -1
  60. package/front_end/ui/components/text_editor/AiCodeCompletionProvider.ts +8 -0
  61. package/front_end/ui/components/text_editor/AiCodeGenerationProvider.ts +8 -0
  62. package/front_end/ui/components/text_editor/config.ts +6 -0
  63. package/front_end/ui/legacy/Toolbar.ts +16 -8
  64. package/front_end/ui/legacy/Treeoutline.ts +4 -4
  65. package/front_end/ui/legacy/UIUtils.ts +35 -4
  66. package/front_end/ui/legacy/components/utils/JSPresentationUtils.ts +6 -11
  67. package/front_end/ui/legacy/components/utils/Linkifier.ts +4 -7
  68. package/front_end/ui/visual_logging/KnownContextValues.ts +1 -0
  69. package/package.json +1 -1
  70. package/front_end/models/issues_manager/descriptions/federatedAuthRequestClientMetadataHttpNotFound.md +0 -1
  71. package/front_end/models/issues_manager/descriptions/federatedAuthRequestClientMetadataInvalidResponse.md +0 -1
  72. package/front_end/models/issues_manager/descriptions/federatedAuthRequestClientMetadataNoResponse.md +0 -1
  73. package/front_end/panels/elements/computedStyleSidebarPane.css +0 -18
@@ -582,10 +582,6 @@ interface AiPromptApi {
582
582
  allowWithoutGpu: boolean;
583
583
  }
584
584
 
585
- interface DevToolsIndividualRequestThrottling {
586
- enabled: boolean;
587
- }
588
-
589
585
  export interface DevToolsEnableDurableMessages {
590
586
  enabled: boolean;
591
587
  }
@@ -631,7 +627,6 @@ export type HostConfig = Platform.TypeScriptUtilities.RecursivePartial<{
631
627
  devToolsAiCodeGeneration: HostConfigAiCodeGeneration,
632
628
  devToolsVeLogging: HostConfigVeLogging,
633
629
  devToolsWellKnown: HostConfigWellKnown,
634
- devToolsIndividualRequestThrottling: DevToolsIndividualRequestThrottling,
635
630
  /**
636
631
  * OffTheRecord here indicates that the user's profile is either incognito,
637
632
  * or guest mode, rather than a "normal" profile.
@@ -1687,19 +1687,8 @@ export class RequestCondition extends Common.ObjectWrapper.ObjectWrapper<Request
1687
1687
  (this.#pattern.upgradedPattern?.constructorString ?? this.#pattern.wildcardURL);
1688
1688
  }
1689
1689
 
1690
- set pattern(pattern: RequestURLPattern|string) {
1691
- if (typeof pattern === 'string') {
1692
- // TODO(pfaffe) Remove once the feature flag is no longer required
1693
- if (Root.Runtime.hostConfig.devToolsIndividualRequestThrottling?.enabled) {
1694
- throw new Error('Should not use wildcard urls');
1695
- }
1696
- this.#pattern = {
1697
- wildcardURL: pattern,
1698
- upgradedPattern: RequestURLPattern.upgradeFromWildcard(pattern) ?? undefined
1699
- };
1700
- } else {
1701
- this.#pattern = pattern;
1702
- }
1690
+ set pattern(pattern: RequestURLPattern) {
1691
+ this.#pattern = pattern;
1703
1692
  this.dispatchEventToListeners(RequestCondition.Events.REQUEST_CONDITION_CHANGED);
1704
1693
  }
1705
1694
 
@@ -1792,10 +1781,7 @@ export class RequestConditions extends Common.ObjectWrapper.ObjectWrapper<Reques
1792
1781
  }
1793
1782
 
1794
1783
  findCondition(pattern: string): RequestCondition|undefined {
1795
- if (Root.Runtime.hostConfig.devToolsIndividualRequestThrottling?.enabled) {
1796
- return this.#conditions.find(condition => condition.constructorString === pattern);
1797
- }
1798
- return this.#conditions.find(condition => condition.wildcardURL === pattern);
1784
+ return this.#conditions.find(condition => condition.constructorString === pattern);
1799
1785
  }
1800
1786
 
1801
1787
  has(url: string): boolean {
@@ -1862,84 +1848,72 @@ export class RequestConditions extends Common.ObjectWrapper.ObjectWrapper<Reques
1862
1848
  function isNonBlockingCondition(condition: ThrottlingConditions): condition is Conditions {
1863
1849
  return !('block' in condition);
1864
1850
  }
1865
- if (Root.Runtime.hostConfig.devToolsIndividualRequestThrottling?.enabled) {
1866
- const urlPatterns: Protocol.Network.BlockPattern[] = [];
1867
- // We store all this info out-of-band to prevent races with changing conditions while the promise is still pending
1868
- const matchedNetworkConditions: Array<{conditions: Conditions, ruleIds?: Set<string>, urlPattern?: string}> = [];
1869
- if (this.conditionsEnabled) {
1870
- for (const condition of this.#conditions) {
1871
- const urlPattern = condition.constructorString;
1872
- const conditions = condition.conditions;
1873
- if (!condition.enabled || !urlPattern || conditions === NoThrottlingConditions) {
1874
- continue;
1875
- }
1876
- const block = !isNonBlockingCondition(conditions);
1877
- urlPatterns.push({urlPattern, block});
1878
- if (!block) {
1879
- const {ruleIds} = condition;
1880
- matchedNetworkConditions.push({ruleIds, urlPattern, conditions});
1881
- }
1851
+ const urlPatterns: Protocol.Network.BlockPattern[] = [];
1852
+ // We store all this info out-of-band to prevent races with changing conditions while the promise is still pending
1853
+ const matchedNetworkConditions: Array<{conditions: Conditions, ruleIds?: Set<string>, urlPattern?: string}> = [];
1854
+ if (this.conditionsEnabled) {
1855
+ for (const condition of this.#conditions) {
1856
+ const urlPattern = condition.constructorString;
1857
+ const conditions = condition.conditions;
1858
+ if (!condition.enabled || !urlPattern || conditions === NoThrottlingConditions) {
1859
+ continue;
1860
+ }
1861
+ const block = !isNonBlockingCondition(conditions);
1862
+ urlPatterns.push({urlPattern, block});
1863
+ if (!block) {
1864
+ const {ruleIds} = condition;
1865
+ matchedNetworkConditions.push({ruleIds, urlPattern, conditions});
1882
1866
  }
1883
1867
  }
1868
+ }
1884
1869
 
1885
- if (globalConditions) {
1886
- matchedNetworkConditions.push({conditions: globalConditions});
1887
- }
1888
-
1889
- const promises: Array<Promise<unknown>> = [];
1890
-
1891
- for (const agent of agents) {
1892
- promises.push(agent.invoke_setBlockedURLs({urlPatterns}));
1893
- promises.push(agent
1894
- .invoke_emulateNetworkConditionsByRule({
1895
- offline,
1896
- matchedNetworkConditions: matchedNetworkConditions.map(
1897
- ({urlPattern, conditions}) => ({
1898
- urlPattern: urlPattern ?? '',
1899
- latency: conditions.latency,
1900
- downloadThroughput: conditions.download < 0 ? 0 : conditions.download,
1901
- uploadThroughput: conditions.upload < 0 ? 0 : conditions.upload,
1902
- packetLoss: (conditions.packetLoss ?? 0) < 0 ? 0 : conditions.packetLoss,
1903
- packetQueueLength: conditions.packetQueueLength,
1904
- packetReordering: conditions.packetReordering,
1905
- connectionType: NetworkManager.connectionType(conditions),
1906
- }))
1907
- })
1908
- .then(response => {
1909
- if (!response.getError()) {
1910
- for (let i = 0; i < response.ruleIds.length; ++i) {
1911
- const ruleId = response.ruleIds[i];
1912
- const {ruleIds, conditions, urlPattern} = matchedNetworkConditions[i];
1913
- if (ruleIds) {
1914
- this.#requestConditionsById.set(ruleId, {urlPattern, conditions});
1915
- matchedNetworkConditions[i].ruleIds?.add(ruleId);
1916
- }
1917
- }
1918
- }
1919
- }));
1920
- promises.push(agent.invoke_overrideNetworkState({
1921
- offline,
1922
- latency: globalConditions?.latency ?? 0,
1923
- downloadThroughput: globalConditions?.download ?? -1,
1924
- uploadThroughput: globalConditions?.upload ?? -1,
1925
- connectionType: globalConditions ? NetworkManager.connectionType(globalConditions) :
1926
- Protocol.Network.ConnectionType.None,
1927
- }));
1928
- }
1929
-
1930
- this.#conditionsAppliedForTestPromise = this.#conditionsAppliedForTestPromise.then(() => Promise.all(promises));
1931
- return urlPatterns.length > 0;
1870
+ if (globalConditions) {
1871
+ matchedNetworkConditions.push({conditions: globalConditions});
1932
1872
  }
1933
1873
 
1934
- const urls = this.conditionsEnabled ?
1935
- this.#conditions.filter(condition => condition.enabled && condition.wildcardURL)
1936
- .map(condition => condition.wildcardURL as string) :
1937
- [];
1874
+ const promises: Array<Promise<unknown>> = [];
1938
1875
 
1939
1876
  for (const agent of agents) {
1940
- void agent.invoke_setBlockedURLs({urls});
1877
+ promises.push(agent.invoke_setBlockedURLs({urlPatterns}));
1878
+ promises.push(agent
1879
+ .invoke_emulateNetworkConditionsByRule({
1880
+ offline,
1881
+ matchedNetworkConditions: matchedNetworkConditions.map(
1882
+ ({urlPattern, conditions}) => ({
1883
+ urlPattern: urlPattern ?? '',
1884
+ latency: conditions.latency,
1885
+ downloadThroughput: conditions.download < 0 ? 0 : conditions.download,
1886
+ uploadThroughput: conditions.upload < 0 ? 0 : conditions.upload,
1887
+ packetLoss: (conditions.packetLoss ?? 0) < 0 ? 0 : conditions.packetLoss,
1888
+ packetQueueLength: conditions.packetQueueLength,
1889
+ packetReordering: conditions.packetReordering,
1890
+ connectionType: NetworkManager.connectionType(conditions),
1891
+ }))
1892
+ })
1893
+ .then(response => {
1894
+ if (!response.getError()) {
1895
+ for (let i = 0; i < response.ruleIds.length; ++i) {
1896
+ const ruleId = response.ruleIds[i];
1897
+ const {ruleIds, conditions, urlPattern} = matchedNetworkConditions[i];
1898
+ if (ruleIds) {
1899
+ this.#requestConditionsById.set(ruleId, {urlPattern, conditions});
1900
+ matchedNetworkConditions[i].ruleIds?.add(ruleId);
1901
+ }
1902
+ }
1903
+ }
1904
+ }));
1905
+ promises.push(agent.invoke_overrideNetworkState({
1906
+ offline,
1907
+ latency: globalConditions?.latency ?? 0,
1908
+ downloadThroughput: globalConditions?.download ?? -1,
1909
+ uploadThroughput: globalConditions?.upload ?? -1,
1910
+ connectionType: globalConditions ? NetworkManager.connectionType(globalConditions) :
1911
+ Protocol.Network.ConnectionType.None,
1912
+ }));
1941
1913
  }
1942
- return urls.length > 0;
1914
+
1915
+ this.#conditionsAppliedForTestPromise = this.#conditionsAppliedForTestPromise.then(() => Promise.all(promises));
1916
+ return urlPatterns.length > 0;
1943
1917
  }
1944
1918
 
1945
1919
  conditionsAppliedForTest(): Promise<unknown> {
@@ -2082,9 +2056,6 @@ export class MultitargetNetworkManager extends Common.ObjectWrapper.ObjectWrappe
2082
2056
  }
2083
2057
  this.#networkAgents.add(networkAgent);
2084
2058
  this.#fetchAgents.add(fetchAgent);
2085
- if (this.isThrottling() && !Root.Runtime.hostConfig.devToolsIndividualRequestThrottling?.enabled) {
2086
- this.updateNetworkConditions(networkAgent);
2087
- }
2088
2059
  }
2089
2060
 
2090
2061
  modelRemoved(networkManager: NetworkManager): void {
@@ -2110,14 +2081,8 @@ export class MultitargetNetworkManager extends Common.ObjectWrapper.ObjectWrappe
2110
2081
 
2111
2082
  setNetworkConditions(conditions: Conditions): void {
2112
2083
  this.#networkConditions = conditions;
2113
- if (Root.Runtime.hostConfig.devToolsIndividualRequestThrottling?.enabled) {
2114
- this.#requestConditions.applyConditions(
2115
- this.isOffline(), this.isThrottling() ? this.#networkConditions : null, ...this.#networkAgents);
2116
- } else {
2117
- for (const agent of this.#networkAgents) {
2118
- this.updateNetworkConditions(agent);
2119
- }
2120
- }
2084
+ this.#requestConditions.applyConditions(
2085
+ this.isOffline(), this.isThrottling() ? this.#networkConditions : null, ...this.#networkAgents);
2121
2086
  this.dispatchEventToListeners(MultitargetNetworkManager.Events.CONDITIONS_CHANGED);
2122
2087
  }
2123
2088
 
@@ -2224,23 +2189,6 @@ export class MultitargetNetworkManager extends Common.ObjectWrapper.ObjectWrappe
2224
2189
  return this.#isBlocking && this.requestConditions.conditionsEnabled;
2225
2190
  }
2226
2191
 
2227
- /**
2228
- * @deprecated Kept for layout tests
2229
- * TODO(pfaffe) remove
2230
- */
2231
- private setBlockingEnabled(enabled: boolean): void {
2232
- this.requestConditions.conditionsEnabled = enabled;
2233
- }
2234
-
2235
- /**
2236
- * @deprecated Kept for layout tests
2237
- * TODO(pfaffe) remove
2238
- */
2239
- private setBlockedPatterns(patterns: Array<{url: string, enabled: boolean}>): void {
2240
- this.requestConditions.clear();
2241
- this.requestConditions.add(...patterns.map(pattern => RequestCondition.createFromSetting(pattern)));
2242
- }
2243
-
2244
2192
  private updateBlockedPatterns(): void {
2245
2193
  this.#isBlocking = this.#requestConditions.applyConditions(
2246
2194
  this.isOffline(), this.isThrottling() ? this.#networkConditions : null, ...this.#networkAgents);
@@ -66,6 +66,11 @@ export abstract class RemoteObject {
66
66
  return matches ? parseInt(matches[1], 10) : 0;
67
67
  }
68
68
 
69
+ static isEmptyArray(object: RemoteObject|Protocol.Runtime.RemoteObject|Protocol.Runtime.ObjectPreview): boolean {
70
+ const matches = object.description?.match(descriptionLengthParenRegex);
71
+ return Boolean(matches?.[1] === '0');
72
+ }
73
+
69
74
  static unserializableDescription(object: unknown): string|null {
70
75
  if (typeof object === 'number') {
71
76
  const description = String(object);
@@ -582,7 +587,8 @@ export class RemoteObjectImpl extends RemoteObject {
582
587
 
583
588
  override isLinearMemoryInspectable(): boolean {
584
589
  return this.type === 'object' && this.subtype !== undefined &&
585
- ['webassemblymemory', 'typedarray', 'dataview', 'arraybuffer'].includes(this.subtype);
590
+ ['webassemblymemory', 'typedarray', 'dataview', 'arraybuffer'].includes(this.subtype) &&
591
+ !RemoteObject.isEmptyArray(this);
586
592
  }
587
593
  }
588
594
 
@@ -254,6 +254,10 @@ class GreenDevFloaty {
254
254
  return messages;
255
255
  }
256
256
 
257
+ #formatError(errorMessage: string): string {
258
+ return `Error: '${errorMessage}' - Protip: to use AI features you need to be signed in.`;
259
+ }
260
+
257
261
  runConversation = async(): Promise<void> => {
258
262
  if (!this.#textField || !this.#node) {
259
263
  return;
@@ -276,7 +280,7 @@ class GreenDevFloaty {
276
280
  nodeDescription: document.querySelector('.green-dev-floaty-dialog-node-description')?.textContent,
277
281
  });
278
282
 
279
- const {content: aiContent} = this.#addMessageInternal('Thinking...', false);
283
+ const aiContent = this.#addMessageInternal('Thinking...', false);
280
284
  this.#syncChannel.postMessage({
281
285
  type: 'new-message',
282
286
  text: 'Thinking...',
@@ -297,9 +301,9 @@ class GreenDevFloaty {
297
301
  {type: 'update-last-message', text: result.text, sessionId: this.#backendNodeId});
298
302
  break;
299
303
  case ResponseType.ERROR:
300
- aiContent.textContent = `Error: ${result.error}`;
304
+ aiContent.textContent = this.#formatError(result.error);
301
305
  this.#syncChannel.postMessage(
302
- {type: 'update-last-message', text: `Error: ${result.error}`, sessionId: this.#backendNodeId});
306
+ {type: 'update-last-message', text: this.#formatError(result.error), sessionId: this.#backendNodeId});
303
307
  break;
304
308
  case ResponseType.SIDE_EFFECT:
305
309
  result.confirm(true);
@@ -316,7 +320,7 @@ class GreenDevFloaty {
316
320
  }
317
321
  };
318
322
 
319
- #addMessageInternal(text: string, isUser: boolean): {content: HTMLDivElement, details?: HTMLDivElement} {
323
+ #addMessageInternal(text: string, isUser: boolean): HTMLDivElement {
320
324
  const messageElement = document.createElement('div');
321
325
  messageElement.className = `message ${isUser ? 'user-message' : 'ai-message'}`;
322
326
 
@@ -325,30 +329,11 @@ class GreenDevFloaty {
325
329
  content.textContent = text;
326
330
  messageElement.appendChild(content);
327
331
 
328
- let details: HTMLDivElement|undefined;
329
- if (!isUser) {
330
- details = document.createElement('div');
331
- details.className = 'message-details';
332
- details.style.display = 'none';
333
- messageElement.appendChild(details);
334
-
335
- const toggle = document.createElement('div');
336
- toggle.className = 'message-details-toggle';
337
- toggle.textContent = 'Show details';
338
- toggle.onclick = () => {
339
- if (details) {
340
- const isHidden = details.style.display === 'none';
341
- details.style.display = isHidden ? 'block' : 'none';
342
- toggle.textContent = isHidden ? 'Hide details' : 'Show details';
343
- }
344
- };
345
- messageElement.appendChild(toggle);
346
- }
347
332
  if (this.#chatContainer) {
348
333
  this.#chatContainer.appendChild(messageElement);
349
334
  this.#chatContainer.scrollTop = this.#chatContainer.scrollHeight;
350
335
  }
351
- return {content, details};
336
+ return content;
352
337
  }
353
338
  }
354
339
 
@@ -251,7 +251,7 @@ html, body {
251
251
  }
252
252
 
253
253
  .green-dev-floaty-disclaimer {
254
- font-size: 16px;
254
+ font-size: 15px;
255
255
  color: #666;
256
256
  text-align: center;
257
257
  margin-top: 8px;
@@ -186,7 +186,7 @@ class GreenDevFloaty {
186
186
  aiContent.textContent = result.text;
187
187
  break;
188
188
  case ResponseType.ERROR:
189
- aiContent.textContent = `Error: ${result.error}`;
189
+ aiContent.textContent = `Error: '${result.error}' - Protip: to use AI features you need to be signed in.`;
190
190
  break;
191
191
  case ResponseType.THOUGHT:
192
192
  if (aiDetails) {
@@ -84,7 +84,7 @@ inspectorBackend.registerEnum("Audits.UnencodedDigestError", {MalformedDictionar
84
84
  inspectorBackend.registerEnum("Audits.ConnectionAllowlistError", {InvalidHeader: "InvalidHeader", MoreThanOneList: "MoreThanOneList", ItemNotInnerList: "ItemNotInnerList", InvalidAllowlistItemType: "InvalidAllowlistItemType", ReportingEndpointNotToken: "ReportingEndpointNotToken", InvalidUrlPattern: "InvalidUrlPattern"});
85
85
  inspectorBackend.registerEnum("Audits.GenericIssueErrorType", {FormLabelForNameError: "FormLabelForNameError", FormDuplicateIdForInputError: "FormDuplicateIdForInputError", FormInputWithNoLabelError: "FormInputWithNoLabelError", FormAutocompleteAttributeEmptyError: "FormAutocompleteAttributeEmptyError", FormEmptyIdAndNameAttributesForInputError: "FormEmptyIdAndNameAttributesForInputError", FormAriaLabelledByToNonExistingIdError: "FormAriaLabelledByToNonExistingIdError", FormInputAssignedAutocompleteValueToIdOrNameAttributeError: "FormInputAssignedAutocompleteValueToIdOrNameAttributeError", FormLabelHasNeitherForNorNestedInputError: "FormLabelHasNeitherForNorNestedInputError", FormLabelForMatchesNonExistingIdError: "FormLabelForMatchesNonExistingIdError", FormInputHasWrongButWellIntendedAutocompleteValueError: "FormInputHasWrongButWellIntendedAutocompleteValueError", ResponseWasBlockedByORB: "ResponseWasBlockedByORB", NavigationEntryMarkedSkippable: "NavigationEntryMarkedSkippable", AutofillAndManualTextPolicyControlledFeaturesInfo: "AutofillAndManualTextPolicyControlledFeaturesInfo", AutofillPolicyControlledFeatureInfo: "AutofillPolicyControlledFeatureInfo", ManualTextPolicyControlledFeatureInfo: "ManualTextPolicyControlledFeatureInfo"});
86
86
  inspectorBackend.registerEnum("Audits.ClientHintIssueReason", {MetaTagAllowListInvalidOrigin: "MetaTagAllowListInvalidOrigin", MetaTagModifiedHTML: "MetaTagModifiedHTML"});
87
- inspectorBackend.registerEnum("Audits.FederatedAuthRequestIssueReason", {ShouldEmbargo: "ShouldEmbargo", TooManyRequests: "TooManyRequests", WellKnownHttpNotFound: "WellKnownHttpNotFound", WellKnownNoResponse: "WellKnownNoResponse", WellKnownInvalidResponse: "WellKnownInvalidResponse", WellKnownListEmpty: "WellKnownListEmpty", WellKnownInvalidContentType: "WellKnownInvalidContentType", ConfigNotInWellKnown: "ConfigNotInWellKnown", WellKnownTooBig: "WellKnownTooBig", ConfigHttpNotFound: "ConfigHttpNotFound", ConfigNoResponse: "ConfigNoResponse", ConfigInvalidResponse: "ConfigInvalidResponse", ConfigInvalidContentType: "ConfigInvalidContentType", ClientMetadataHttpNotFound: "ClientMetadataHttpNotFound", ClientMetadataNoResponse: "ClientMetadataNoResponse", ClientMetadataInvalidResponse: "ClientMetadataInvalidResponse", ClientMetadataInvalidContentType: "ClientMetadataInvalidContentType", IdpNotPotentiallyTrustworthy: "IdpNotPotentiallyTrustworthy", DisabledInSettings: "DisabledInSettings", DisabledInFlags: "DisabledInFlags", ErrorFetchingSignin: "ErrorFetchingSignin", InvalidSigninResponse: "InvalidSigninResponse", AccountsHttpNotFound: "AccountsHttpNotFound", AccountsNoResponse: "AccountsNoResponse", AccountsInvalidResponse: "AccountsInvalidResponse", AccountsListEmpty: "AccountsListEmpty", AccountsInvalidContentType: "AccountsInvalidContentType", IdTokenHttpNotFound: "IdTokenHttpNotFound", IdTokenNoResponse: "IdTokenNoResponse", IdTokenInvalidResponse: "IdTokenInvalidResponse", IdTokenIdpErrorResponse: "IdTokenIdpErrorResponse", IdTokenCrossSiteIdpErrorResponse: "IdTokenCrossSiteIdpErrorResponse", IdTokenInvalidRequest: "IdTokenInvalidRequest", IdTokenInvalidContentType: "IdTokenInvalidContentType", ErrorIdToken: "ErrorIdToken", Canceled: "Canceled", RpPageNotVisible: "RpPageNotVisible", SilentMediationFailure: "SilentMediationFailure", ThirdPartyCookiesBlocked: "ThirdPartyCookiesBlocked", NotSignedInWithIdp: "NotSignedInWithIdp", MissingTransientUserActivation: "MissingTransientUserActivation", ReplacedByActiveMode: "ReplacedByActiveMode", InvalidFieldsSpecified: "InvalidFieldsSpecified", RelyingPartyOriginIsOpaque: "RelyingPartyOriginIsOpaque", TypeNotMatching: "TypeNotMatching", UiDismissedNoEmbargo: "UiDismissedNoEmbargo", CorsError: "CorsError", SuppressedBySegmentationPlatform: "SuppressedBySegmentationPlatform"});
87
+ inspectorBackend.registerEnum("Audits.FederatedAuthRequestIssueReason", {ShouldEmbargo: "ShouldEmbargo", TooManyRequests: "TooManyRequests", WellKnownHttpNotFound: "WellKnownHttpNotFound", WellKnownNoResponse: "WellKnownNoResponse", WellKnownInvalidResponse: "WellKnownInvalidResponse", WellKnownListEmpty: "WellKnownListEmpty", WellKnownInvalidContentType: "WellKnownInvalidContentType", ConfigNotInWellKnown: "ConfigNotInWellKnown", WellKnownTooBig: "WellKnownTooBig", ConfigHttpNotFound: "ConfigHttpNotFound", ConfigNoResponse: "ConfigNoResponse", ConfigInvalidResponse: "ConfigInvalidResponse", ConfigInvalidContentType: "ConfigInvalidContentType", IdpNotPotentiallyTrustworthy: "IdpNotPotentiallyTrustworthy", DisabledInSettings: "DisabledInSettings", DisabledInFlags: "DisabledInFlags", ErrorFetchingSignin: "ErrorFetchingSignin", InvalidSigninResponse: "InvalidSigninResponse", AccountsHttpNotFound: "AccountsHttpNotFound", AccountsNoResponse: "AccountsNoResponse", AccountsInvalidResponse: "AccountsInvalidResponse", AccountsListEmpty: "AccountsListEmpty", AccountsInvalidContentType: "AccountsInvalidContentType", IdTokenHttpNotFound: "IdTokenHttpNotFound", IdTokenNoResponse: "IdTokenNoResponse", IdTokenInvalidResponse: "IdTokenInvalidResponse", IdTokenIdpErrorResponse: "IdTokenIdpErrorResponse", IdTokenCrossSiteIdpErrorResponse: "IdTokenCrossSiteIdpErrorResponse", IdTokenInvalidRequest: "IdTokenInvalidRequest", IdTokenInvalidContentType: "IdTokenInvalidContentType", ErrorIdToken: "ErrorIdToken", Canceled: "Canceled", RpPageNotVisible: "RpPageNotVisible", SilentMediationFailure: "SilentMediationFailure", NotSignedInWithIdp: "NotSignedInWithIdp", MissingTransientUserActivation: "MissingTransientUserActivation", ReplacedByActiveMode: "ReplacedByActiveMode", RelyingPartyOriginIsOpaque: "RelyingPartyOriginIsOpaque", TypeNotMatching: "TypeNotMatching", UiDismissedNoEmbargo: "UiDismissedNoEmbargo", CorsError: "CorsError", SuppressedBySegmentationPlatform: "SuppressedBySegmentationPlatform"});
88
88
  inspectorBackend.registerEnum("Audits.FederatedAuthUserInfoRequestIssueReason", {NotSameOrigin: "NotSameOrigin", NotIframe: "NotIframe", NotPotentiallyTrustworthy: "NotPotentiallyTrustworthy", NoAPIPermission: "NoApiPermission", NotSignedInWithIdp: "NotSignedInWithIdp", NoAccountSharingPermission: "NoAccountSharingPermission", InvalidConfigOrWellKnown: "InvalidConfigOrWellKnown", InvalidAccountsResponse: "InvalidAccountsResponse", NoReturningUserFromFetchedAccounts: "NoReturningUserFromFetchedAccounts"});
89
89
  inspectorBackend.registerEnum("Audits.PartitioningBlobURLInfo", {BlockedCrossPartitionFetching: "BlockedCrossPartitionFetching", EnforceNoopenerForNavigation: "EnforceNoopenerForNavigation"});
90
90
  inspectorBackend.registerEnum("Audits.ElementAccessibilityIssueReason", {DisallowedSelectChild: "DisallowedSelectChild", DisallowedOptGroupChild: "DisallowedOptGroupChild", NonPhrasingContentOptionChild: "NonPhrasingContentOptionChild", InteractiveContentOptionChild: "InteractiveContentOptionChild", InteractiveContentLegendChild: "InteractiveContentLegendChild", InteractiveContentSummaryDescendant: "InteractiveContentSummaryDescendant"});
@@ -4552,6 +4552,7 @@ export const generatedProperties = [
4552
4552
  "uppercase",
4553
4553
  "lowercase",
4554
4554
  "full-width",
4555
+ "full-size-kana",
4555
4556
  "none",
4556
4557
  "math-auto"
4557
4558
  ],
@@ -7048,6 +7049,7 @@ export const generatedPropertyValues = {
7048
7049
  "uppercase",
7049
7050
  "lowercase",
7050
7051
  "full-width",
7052
+ "full-size-kana",
7051
7053
  "none",
7052
7054
  "math-auto"
7053
7055
  ]
@@ -1292,10 +1292,6 @@ export namespace Audits {
1292
1292
  ConfigNoResponse = 'ConfigNoResponse',
1293
1293
  ConfigInvalidResponse = 'ConfigInvalidResponse',
1294
1294
  ConfigInvalidContentType = 'ConfigInvalidContentType',
1295
- ClientMetadataHttpNotFound = 'ClientMetadataHttpNotFound',
1296
- ClientMetadataNoResponse = 'ClientMetadataNoResponse',
1297
- ClientMetadataInvalidResponse = 'ClientMetadataInvalidResponse',
1298
- ClientMetadataInvalidContentType = 'ClientMetadataInvalidContentType',
1299
1295
  IdpNotPotentiallyTrustworthy = 'IdpNotPotentiallyTrustworthy',
1300
1296
  DisabledInSettings = 'DisabledInSettings',
1301
1297
  DisabledInFlags = 'DisabledInFlags',
@@ -1317,11 +1313,9 @@ export namespace Audits {
1317
1313
  Canceled = 'Canceled',
1318
1314
  RpPageNotVisible = 'RpPageNotVisible',
1319
1315
  SilentMediationFailure = 'SilentMediationFailure',
1320
- ThirdPartyCookiesBlocked = 'ThirdPartyCookiesBlocked',
1321
1316
  NotSignedInWithIdp = 'NotSignedInWithIdp',
1322
1317
  MissingTransientUserActivation = 'MissingTransientUserActivation',
1323
1318
  ReplacedByActiveMode = 'ReplacedByActiveMode',
1324
- InvalidFieldsSpecified = 'InvalidFieldsSpecified',
1325
1319
  RelyingPartyOriginIsOpaque = 'RelyingPartyOriginIsOpaque',
1326
1320
  TypeNotMatching = 'TypeNotMatching',
1327
1321
  UiDismissedNoEmbargo = 'UiDismissedNoEmbargo',
@@ -31,7 +31,7 @@ Content:
31
31
  "function_declarations": [
32
32
  {
33
33
  "name": "listNetworkRequests",
34
- "description": "Gives a list of network requests including URL, status code, and duration in ms",
34
+ "description": "Gives a list of network requests including URL, status code, and duration in ms.",
35
35
  "parameters": {
36
36
  "type": 6,
37
37
  "description": "",
@@ -42,7 +42,7 @@ Content:
42
42
  },
43
43
  {
44
44
  "name": "selectNetworkRequest",
45
- "description": "From the list of selected request select one to debug",
45
+ "description": "Selects a specific network request to further provide information about. Use this when asked about network requests issues.",
46
46
  "parameters": {
47
47
  "type": 6,
48
48
  "description": "",
@@ -72,7 +72,7 @@ Content:
72
72
  },
73
73
  {
74
74
  "name": "selectSourceFile",
75
- "description": "Returns a list of all files in the project.",
75
+ "description": "Selects a source file. Use this when asked about files on the page.",
76
76
  "parameters": {
77
77
  "type": 6,
78
78
  "description": "",
@@ -83,7 +83,7 @@ Content:
83
83
  "properties": {
84
84
  "name": {
85
85
  "type": 1,
86
- "description": "The name of the file",
86
+ "description": "The name of the file you want to select.",
87
87
  "nullable": false
88
88
  }
89
89
  }
@@ -91,7 +91,7 @@ Content:
91
91
  },
92
92
  {
93
93
  "name": "performanceRecordAndReload",
94
- "description": "Start a new performance recording and reload the page.",
94
+ "description": "Records a new performance trace, to help debug performance issue.",
95
95
  "parameters": {
96
96
  "type": 6,
97
97
  "description": "",
@@ -102,7 +102,7 @@ Content:
102
102
  },
103
103
  {
104
104
  "name": "inspectDom",
105
- "description": "Prompts user to select a DOM element from the page.",
105
+ "description": "Prompts user to select a DOM element from the page. Use this when you don't know which element is selected.",
106
106
  "parameters": {
107
107
  "type": 6,
108
108
  "description": "",
@@ -32,7 +32,7 @@ You aim to help developers of all levels, prioritizing teaching web concepts as
32
32
 
33
33
  # Considerations
34
34
  * Determine what the question the domain of the question is - styling, network, sources, performance or other part of DevTools.
35
- * When possible proactively try to gather additional data and select context that they user may find relevant to the question they are asking utilizing the function calls available to you.
35
+ * Proactively try to gather additional data. If a select specific data can be selected, select one.
36
36
  * Avoid making assumptions without sufficient evidence, and always seek further clarification if needed.
37
37
  * Always explore multiple possible explanations for the observed behavior before settling on a conclusion.
38
38
  * When presenting solutions, clearly distinguish between the primary cause and contributing factors.
@@ -85,7 +85,7 @@ export class ContextSelectionAgent extends AiAgent<never> {
85
85
  this.#onInspectElement = opts.onInspectElement;
86
86
 
87
87
  this.declareFunction<Record<string, never>>('listNetworkRequests', {
88
- description: `Gives a list of network requests including URL, status code, and duration in ms`,
88
+ description: `Gives a list of network requests including URL, status code, and duration in ms.`,
89
89
  parameters: {
90
90
  type: Host.AidaClient.ParametersTypes.OBJECT,
91
91
  description: '',
@@ -116,6 +116,12 @@ export class ContextSelectionAgent extends AiAgent<never> {
116
116
  });
117
117
  }
118
118
 
119
+ if (requests.length === 0) {
120
+ return {
121
+ error: 'No requests recorded by DevTools',
122
+ };
123
+ }
124
+
119
125
  return {
120
126
  result: requests,
121
127
  };
@@ -123,7 +129,8 @@ export class ContextSelectionAgent extends AiAgent<never> {
123
129
  });
124
130
 
125
131
  this.declareFunction<{url: string}>('selectNetworkRequest', {
126
- description: `From the list of selected request select one to debug`,
132
+ description:
133
+ `Selects a specific network request to further provide information about. Use this when asked about network requests issues.`,
127
134
  parameters: {
128
135
  type: Host.AidaClient.ParametersTypes.OBJECT,
129
136
  description: '',
@@ -191,7 +198,7 @@ export class ContextSelectionAgent extends AiAgent<never> {
191
198
  });
192
199
 
193
200
  this.declareFunction<{name: string}>('selectSourceFile', {
194
- description: `Returns a list of all files in the project.`,
201
+ description: `Selects a source file. Use this when asked about files on the page.`,
195
202
  parameters: {
196
203
  type: Host.AidaClient.ParametersTypes.OBJECT,
197
204
  description: '',
@@ -200,14 +207,14 @@ export class ContextSelectionAgent extends AiAgent<never> {
200
207
  properties: {
201
208
  name: {
202
209
  type: Host.AidaClient.ParametersTypes.STRING,
203
- description: 'The name of the file',
210
+ description: 'The name of the file you want to select.',
204
211
  nullable: false,
205
212
  },
206
213
  },
207
214
  },
208
215
  displayInfoFromArgs: args => {
209
216
  return {
210
- title: lockedString('Getting source file'),
217
+ title: lockedString('Getting source file'),
211
218
  action: `selectSourceFile(${args.name})`,
212
219
  };
213
220
  },
@@ -225,7 +232,7 @@ export class ContextSelectionAgent extends AiAgent<never> {
225
232
  });
226
233
 
227
234
  this.declareFunction('performanceRecordAndReload', {
228
- description: 'Start a new performance recording and reload the page.',
235
+ description: 'Records a new performance trace, to help debug performance issue.',
229
236
  parameters: {
230
237
  type: Host.AidaClient.ParametersTypes.OBJECT,
231
238
  description: '',
@@ -254,7 +261,8 @@ export class ContextSelectionAgent extends AiAgent<never> {
254
261
  });
255
262
 
256
263
  this.declareFunction<Record<string, never>>('inspectDom', {
257
- description: `Prompts user to select a DOM element from the page.`,
264
+ description:
265
+ `Prompts user to select a DOM element from the page. Use this when you don't know which element is selected.`,
258
266
  parameters: {
259
267
  type: Host.AidaClient.ParametersTypes.OBJECT,
260
268
  description: '',
@@ -264,7 +272,7 @@ export class ContextSelectionAgent extends AiAgent<never> {
264
272
  },
265
273
  displayInfoFromArgs: () => {
266
274
  return {
267
- title: lockedString('Please select an element on the page...'),
275
+ title: lockedString('Please select an element on the page'),
268
276
  action: 'selectElement()',
269
277
  };
270
278
  },
@@ -80,10 +80,6 @@ const UIStringsNotTranslate = {
80
80
  * @description Title text for request timing details.
81
81
  */
82
82
  timing: 'Timing',
83
- /**
84
- * @description Prefix text for response status.
85
- */
86
- responseStatus: 'Response Status',
87
83
  /**
88
84
  * @description Title text for request initiator chain.
89
85
  */
@@ -178,8 +174,8 @@ async function createContextDetailsForNetworkAgent(
178
174
 
179
175
  const responseContextDetail: ContextDetail = {
180
176
  title: lockedString(UIStringsNotTranslate.response),
181
- text: lockedString(UIStringsNotTranslate.responseStatus) + ': ' + request.statusCode + ' ' + request.statusText +
182
- `\n\n${formatter.formatResponseHeaders()}` + responseBodyString,
177
+ text: formatter.formatResponseHeaders() + responseBodyString +
178
+ `\n\n${formatter.formatStatus()}${formatter.formatFailureReasons()}`,
183
179
  };
184
180
  const timingContextDetail: ContextDetail = {
185
181
  title: lockedString(UIStringsNotTranslate.timing),