chrome-devtools-frontend 1.0.1583146 → 1.0.1585664

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 (119) hide show
  1. package/front_end/core/host/InspectorFrontendHostAPI.ts +1 -0
  2. package/front_end/core/host/InspectorFrontendHostStub.ts +2 -0
  3. package/front_end/core/root/Runtime.ts +12 -6
  4. package/front_end/core/sdk/CSSMatchedStyles.ts +3 -0
  5. package/front_end/core/sdk/CSSMetadata.ts +3 -0
  6. package/front_end/entrypoints/main/MainImpl.ts +1 -0
  7. package/front_end/generated/Deprecation.ts +21 -0
  8. package/front_end/generated/InspectorBackendCommands.ts +5 -3
  9. package/front_end/generated/SupportedCSSProperties.js +10 -4
  10. package/front_end/generated/protocol-mapping.d.ts +2 -1
  11. package/front_end/generated/protocol-proxy-api.d.ts +2 -1
  12. package/front_end/generated/protocol.ts +14 -0
  13. package/front_end/models/ai_assistance/AiConversation.ts +34 -2
  14. package/front_end/models/ai_assistance/BuiltInAi.ts +1 -2
  15. package/front_end/models/ai_assistance/agents/AiAgent.ts +3 -10
  16. package/front_end/models/ai_assistance/agents/ContextSelectionAgent.snapshot.txt +1 -1
  17. package/front_end/models/ai_assistance/agents/ContextSelectionAgent.ts +17 -9
  18. package/front_end/models/ai_assistance/agents/StylingAgent.snapshot.txt +0 -24
  19. package/front_end/models/ai_code_completion/AiCodeCompletion.ts +12 -0
  20. package/front_end/models/ai_code_generation/AiCodeGeneration.ts +5 -0
  21. package/front_end/models/bindings/DebuggerWorkspaceBinding.ts +16 -8
  22. package/front_end/models/computed_style/ComputedStyleModel.ts +20 -15
  23. package/front_end/models/greendev/Prototypes.ts +1 -5
  24. package/front_end/models/issues_manager/CorsIssue.ts +2 -9
  25. package/front_end/models/issues_manager/descriptions/corsLocalNetworkAccessPermissionDenied.md +2 -2
  26. package/front_end/models/javascript_metadata/NativeFunctions.js +20 -0
  27. package/front_end/panels/ai_assistance/AiAssistancePanel.ts +13 -36
  28. package/front_end/panels/ai_assistance/components/ChatInput.ts +73 -95
  29. package/front_end/panels/ai_assistance/components/ChatView.ts +13 -2
  30. package/front_end/panels/application/FrameDetailsView.ts +4 -9
  31. package/front_end/panels/common/AiCodeGenerationTeaser.ts +10 -0
  32. package/front_end/panels/console/ConsoleView.ts +1 -2
  33. package/front_end/panels/console/ConsoleViewMessage.ts +19 -12
  34. package/front_end/panels/elements/ComputedStyleWidget.ts +41 -21
  35. package/front_end/panels/elements/ElementsPanel.ts +18 -5
  36. package/front_end/panels/elements/ElementsTreeElement.ts +173 -169
  37. package/front_end/panels/elements/NodeStackTraceWidget.ts +3 -13
  38. package/front_end/panels/elements/StylesAiCodeCompletionProvider.ts +69 -0
  39. package/front_end/panels/elements/computedStyleWidget.css +1 -6
  40. package/front_end/panels/elements/elements.ts +3 -1
  41. package/front_end/panels/issues/AffectedResourcesView.ts +1 -2
  42. package/front_end/panels/network/NetworkDataGridNode.ts +0 -8
  43. package/front_end/panels/network/RequestConditionsDrawer.ts +138 -112
  44. package/front_end/panels/network/RequestInitiatorView.ts +2 -10
  45. package/front_end/panels/settings/SettingsScreen.ts +12 -4
  46. package/front_end/panels/snippets/SnippetsQuickOpen.ts +6 -9
  47. package/front_end/panels/sources/CallStackSidebarPane.ts +4 -6
  48. package/front_end/panels/sources/DebuggerPlugin.ts +2 -1
  49. package/front_end/panels/sources/GoToLineQuickOpen.ts +0 -4
  50. package/front_end/panels/sources/OpenFileQuickOpen.ts +0 -4
  51. package/front_end/panels/sources/OutlineQuickOpen.ts +0 -4
  52. package/front_end/panels/sources/WatchExpressionsSidebarPane.ts +3 -1
  53. package/front_end/panels/sources/sources-meta.ts +9 -6
  54. package/front_end/panels/timeline/TimelineFlameChartView.ts +0 -12
  55. package/front_end/panels/timeline/TimelinePanel.ts +35 -15
  56. package/front_end/panels/timeline/TimelineUIUtils.ts +2 -6
  57. package/front_end/panels/timeline/components/Sidebar.ts +21 -0
  58. package/front_end/panels/timeline/components/insights/BaseInsightComponent.ts +1 -20
  59. package/front_end/panels/timeline/components/insights/InsightRenderer.ts +0 -1
  60. package/front_end/third_party/chromium/README.chromium +1 -1
  61. package/front_end/third_party/puppeteer/README.chromium +2 -2
  62. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/core/BrowsingContext.d.ts +1 -1
  63. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/core/BrowsingContext.d.ts.map +1 -1
  64. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/core/BrowsingContext.js +1 -1
  65. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/core/BrowsingContext.js.map +1 -1
  66. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/node/ChromeLauncher.d.ts.map +1 -1
  67. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/node/ChromeLauncher.js +2 -3
  68. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/node/ChromeLauncher.js.map +1 -1
  69. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/revisions.d.ts +2 -2
  70. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/revisions.js +2 -2
  71. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/util/encoding.d.ts.map +1 -1
  72. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/util/encoding.js +5 -3
  73. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/util/encoding.js.map +1 -1
  74. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/util/version.d.ts +1 -1
  75. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/util/version.js +1 -1
  76. package/front_end/third_party/puppeteer/package/lib/es5-iife/puppeteer-core-browser.js +8 -6
  77. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/core/BrowsingContext.d.ts +1 -1
  78. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/core/BrowsingContext.d.ts.map +1 -1
  79. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/core/BrowsingContext.js +1 -1
  80. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/core/BrowsingContext.js.map +1 -1
  81. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/node/ChromeLauncher.d.ts.map +1 -1
  82. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/node/ChromeLauncher.js +2 -3
  83. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/node/ChromeLauncher.js.map +1 -1
  84. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/revisions.d.ts +2 -2
  85. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/revisions.js +2 -2
  86. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/util/encoding.d.ts.map +1 -1
  87. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/util/encoding.js +5 -3
  88. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/util/encoding.js.map +1 -1
  89. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/util/version.d.ts +1 -1
  90. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/util/version.js +1 -1
  91. package/front_end/third_party/puppeteer/package/package.json +4 -4
  92. package/front_end/third_party/puppeteer/package/src/bidi/Page.ts +1 -1
  93. package/front_end/third_party/puppeteer/package/src/bidi/core/BrowsingContext.ts +2 -2
  94. package/front_end/third_party/puppeteer/package/src/node/ChromeLauncher.ts +4 -3
  95. package/front_end/third_party/puppeteer/package/src/revisions.ts +2 -2
  96. package/front_end/third_party/puppeteer/package/src/util/encoding.ts +5 -3
  97. package/front_end/third_party/puppeteer/package/src/util/version.ts +1 -1
  98. package/front_end/ui/components/linkifier/LinkifierImpl.ts +3 -0
  99. package/front_end/ui/components/linkifier/LinkifierUtils.ts +3 -0
  100. package/front_end/ui/components/text_editor/AiCodeGenerationParser.ts +29 -7
  101. package/front_end/ui/components/text_editor/AiCodeGenerationProvider.ts +34 -18
  102. package/front_end/ui/legacy/InspectorView.ts +41 -15
  103. package/front_end/ui/legacy/UIUtils.ts +30 -6
  104. package/front_end/ui/legacy/components/quick_open/CommandMenu.ts +4 -3
  105. package/front_end/ui/legacy/components/quick_open/FilteredListWidget.ts +2 -1
  106. package/front_end/ui/legacy/components/quick_open/HelpQuickOpen.ts +8 -2
  107. package/front_end/ui/legacy/components/quick_open/QuickOpen.ts +8 -8
  108. package/front_end/ui/legacy/components/utils/JSPresentationUtils.ts +20 -150
  109. package/front_end/ui/legacy/components/utils/Linkifier.ts +120 -87
  110. package/front_end/ui/legacy/components/utils/jsUtils.css +0 -9
  111. package/front_end/ui/legacy/legacy.ts +0 -2
  112. package/front_end/ui/visual_logging/KnownContextValues.ts +3 -0
  113. package/mcp/HostBindings.ts +3 -0
  114. package/package.json +1 -1
  115. package/front_end/models/issues_manager/descriptions/corsInsecurePrivateNetwork.md +0 -10
  116. package/front_end/models/issues_manager/descriptions/corsPreflightAllowPrivateNetworkError.md +0 -10
  117. package/front_end/models/issues_manager/descriptions/corsPrivateNetworkPermissionDenied.md +0 -10
  118. package/front_end/ui/legacy/Floaty.ts +0 -438
  119. package/front_end/ui/legacy/floaty.css +0 -77
@@ -9,9 +9,9 @@ import * as Platform from '../../../core/platform/platform.js';
9
9
  import * as Root from '../../../core/root/root.js';
10
10
  import * as SDK from '../../../core/sdk/sdk.js';
11
11
  import * as Logs from '../../logs/logs.js';
12
+ import * as NetworkTimeCalculator from '../../network_time_calculator/network_time_calculator.js';
12
13
  import type * as Trace from '../../trace/trace.js';
13
14
  import * as Workspace from '../../workspace/workspace.js';
14
- import {AgentFocus} from '../performance/AIContext.js';
15
15
 
16
16
  import {
17
17
  type AgentOptions,
@@ -19,6 +19,10 @@ import {
19
19
  type ContextResponse,
20
20
  type RequestOptions,
21
21
  } from './AiAgent.js';
22
+ import {FileContext} from './FileAgent.js';
23
+ import {RequestContext} from './NetworkAgent.js';
24
+ import {PerformanceTraceContext} from './PerformanceAgent.js';
25
+ import {NodeContext} from './StylingAgent.js';
22
26
 
23
27
  const lockedString = i18n.i18n.lockedString;
24
28
  /**
@@ -33,8 +37,8 @@ You aim to help developers of all levels, prioritizing teaching web concepts as
33
37
  # Considerations
34
38
  * Determine what the question the domain of the question is - styling, network, sources, performance or other part of DevTools.
35
39
  * Proactively try to gather additional data. If a select specific data can be selected, select one.
40
+ * Always try select single specific context before answering the question.
36
41
  * Avoid making assumptions without sufficient evidence, and always seek further clarification if needed.
37
- * Always explore multiple possible explanations for the observed behavior before settling on a conclusion.
38
42
  * When presenting solutions, clearly distinguish between the primary cause and contributing factors.
39
43
  * Please answer only if you are sure about the answer. Otherwise, explain why you're not able to answer.
40
44
  * When answering, always consider MULTIPLE possible solutions.
@@ -46,7 +50,6 @@ You aim to help developers of all levels, prioritizing teaching web concepts as
46
50
  * Always specify the language for code blocks (e.g., \`\`\`css, \`\`\`javascript).
47
51
  * Keep text responses concise and scannable.
48
52
 
49
- * ALWAYS OUTPUT a list of follow-up queries at the end of your text response. The format is SUGGESTIONS: ["suggestion1", "suggestion2", "suggestion3"]. Make sure that the array and the \`SUGGESTIONS: \` text is in the same line. You're also capable of executing the fix for the issue user mentioned. Reflect this in your suggestions.
50
53
  * **CRITICAL** NEVER write full Python programs - you should only write individual statements that invoke a single function from the provided library.
51
54
  * **CRITICAL** NEVER output text before a function call. Always do a function call first.
52
55
  * **CRITICAL** You are a debugging assistant in DevTools. NEVER provide answers to questions of unrelated topics such as legal advice, financial advice, personal opinions, medical advice, religion, race, politics, sexuality, gender, or any other non web-development topics. Answer "Sorry, I can't answer that. I'm best at questions about debugging web pages." to such questions.
@@ -75,17 +78,20 @@ export class ContextSelectionAgent extends AiAgent<never> {
75
78
 
76
79
  readonly #performanceRecordAndReload?: () => Promise<Trace.TraceModel.ParsedTrace>;
77
80
  readonly #onInspectElement?: () => Promise<SDK.DOMModel.DOMNode|null>;
81
+ readonly #networkTimeCalculator?: NetworkTimeCalculator.NetworkTransferTimeCalculator;
78
82
 
79
83
  constructor(opts: AgentOptions&{
80
84
  performanceRecordAndReload?: () => Promise<Trace.TraceModel.ParsedTrace>,
81
85
  onInspectElement?: () => Promise<SDK.DOMModel.DOMNode|null>,
86
+ networkTimeCalculator?: NetworkTimeCalculator.NetworkTransferTimeCalculator,
82
87
  }) {
83
88
  super(opts);
84
89
  this.#performanceRecordAndReload = opts.performanceRecordAndReload;
85
90
  this.#onInspectElement = opts.onInspectElement;
91
+ this.#networkTimeCalculator = opts.networkTimeCalculator;
86
92
 
87
93
  this.declareFunction<Record<string, never>>('listNetworkRequests', {
88
- description: `Gives a list of network requests including URL, status code, and duration in ms.`,
94
+ description: `Gives a list of network requests including URL, status code, and duration.`,
89
95
  parameters: {
90
96
  type: Host.AidaClient.ParametersTypes.OBJECT,
91
97
  description: '',
@@ -109,10 +115,11 @@ export class ContextSelectionAgent extends AiAgent<never> {
109
115
  if (mainSecurityOrigin && request.securityOrigin() !== mainSecurityOrigin) {
110
116
  continue;
111
117
  }
118
+
112
119
  requests.push({
113
120
  url: request.url(),
114
121
  statusCode: request.statusCode,
115
- duration: request.duration,
122
+ duration: i18n.TimeUtilities.secondsToString(request.duration),
116
123
  });
117
124
  }
118
125
 
@@ -159,8 +166,9 @@ export class ContextSelectionAgent extends AiAgent<never> {
159
166
  });
160
167
 
161
168
  if (request) {
169
+ const calculator = this.#networkTimeCalculator ?? new NetworkTimeCalculator.NetworkTransferTimeCalculator();
162
170
  return {
163
- context: request,
171
+ context: new RequestContext(request, calculator),
164
172
  };
165
173
  }
166
174
 
@@ -222,7 +230,7 @@ export class ContextSelectionAgent extends AiAgent<never> {
222
230
  for (const file of this.#getUISourceCodes()) {
223
231
  if (file.fullDisplayName() === params.name) {
224
232
  return {
225
- context: file,
233
+ context: new FileContext(file),
226
234
  };
227
235
  }
228
236
  }
@@ -255,7 +263,7 @@ export class ContextSelectionAgent extends AiAgent<never> {
255
263
  const result = await this.#performanceRecordAndReload();
256
264
 
257
265
  return {
258
- context: AgentFocus.fromParsedTrace(result),
266
+ context: PerformanceTraceContext.fromParsedTrace(result),
259
267
  };
260
268
  }
261
269
  });
@@ -283,7 +291,7 @@ export class ContextSelectionAgent extends AiAgent<never> {
283
291
  const node = await this.#onInspectElement();
284
292
  if (node) {
285
293
  return {
286
- context: node,
294
+ context: new NodeContext(node),
287
295
  };
288
296
  }
289
297
  return {
@@ -190,10 +190,6 @@ Content:
190
190
  Title: StylingAgent run generates an answer immediately
191
191
  Content:
192
192
  [
193
- {
194
- "type": "user-query",
195
- "query": "test"
196
- },
197
193
  {
198
194
  "type": "context",
199
195
  "title": "Analyzing the prompt",
@@ -274,10 +270,6 @@ Content:
274
270
  Title: StylingAgent run generates an rpcId for the answer
275
271
  Content:
276
272
  [
277
- {
278
- "type": "user-query",
279
- "query": "test"
280
- },
281
273
  {
282
274
  "type": "context",
283
275
  "title": "Analyzing the prompt",
@@ -303,10 +295,6 @@ Content:
303
295
  Title: StylingAgent run throws an error based on the attribution metadata including RecitationAction.BLOCK
304
296
  Content:
305
297
  [
306
- {
307
- "type": "user-query",
308
- "query": "test"
309
- },
310
298
  {
311
299
  "type": "context",
312
300
  "title": "Analyzing the prompt",
@@ -335,10 +323,6 @@ Content:
335
323
  Title: StylingAgent run does not throw an error based on attribution metadata not including RecitationAction.BLOCK
336
324
  Content:
337
325
  [
338
- {
339
- "type": "user-query",
340
- "query": "test"
341
- },
342
326
  {
343
327
  "type": "context",
344
328
  "title": "Analyzing the prompt",
@@ -364,10 +348,6 @@ Content:
364
348
  Title: StylingAgent run generates a response if nothing is returned
365
349
  Content:
366
350
  [
367
- {
368
- "type": "user-query",
369
- "query": "test"
370
- },
371
351
  {
372
352
  "type": "context",
373
353
  "title": "Analyzing the prompt",
@@ -391,10 +371,6 @@ Content:
391
371
  Title: StylingAgent run generates an action response if action and answer both present
392
372
  Content:
393
373
  [
394
- {
395
- "type": "user-query",
396
- "query": "test"
397
- },
398
374
  {
399
375
  "type": "context",
400
376
  "title": "Analyzing the prompt",
@@ -346,6 +346,18 @@ export class AiCodeCompletion {
346
346
  }
347
347
  return Boolean(aidaAvailability.enabled && Root.Runtime.hostConfig.devToolsAiCodeCompletion?.enabled);
348
348
  }
349
+
350
+ static isAiCodeCompletionStylesEnabled(locale: string): boolean {
351
+ if (!locale.startsWith('en-')) {
352
+ return false;
353
+ }
354
+ const aidaAvailability = Root.Runtime.hostConfig.aidaAvailability;
355
+ if (!aidaAvailability || aidaAvailability.blockedByGeo || aidaAvailability.blockedByAge ||
356
+ aidaAvailability.blockedByEnterprisePolicy) {
357
+ return false;
358
+ }
359
+ return Boolean(aidaAvailability.enabled && Root.Runtime.hostConfig.devToolsAiCodeCompletionStyles?.enabled);
360
+ }
349
361
  }
350
362
 
351
363
  export const enum ContextFlavor {
@@ -22,6 +22,11 @@ Your role is to act as an expert pair programmer within the Chrome DevTools envi
22
22
  * **Return ONLY code blocks.** * Do NOT include any introductory text, explanations, or concluding remarks.
23
23
  * Do NOT provide step-by-step guides or descriptions of how the code works.
24
24
  * Inline comments within the code are permitted and encouraged for clarity.
25
+
26
+ 3. **Handling Ambiguity:**
27
+ * If the user's request is vague, unclear, or lacks sufficient detail to generate a functional solution, do NOT generate placeholder code.
28
+ * Instead, output a single comment block asking for specific clarification on the desired task or logic.
29
+ * Example output for vague input: // The request is unclear. Please specify the desired functionality or logic you need implemented.
25
30
  `;
26
31
 
27
32
  export const additionalContextForConsole = `
@@ -24,7 +24,7 @@ import {type ResourceScriptFile, ResourceScriptMapping} from './ResourceScriptMa
24
24
  export class DebuggerWorkspaceBinding implements SDK.TargetManager.SDKModelObserver<SDK.DebuggerModel.DebuggerModel> {
25
25
  readonly resourceMapping: ResourceMapping;
26
26
  readonly #debuggerModelToData: Map<SDK.DebuggerModel.DebuggerModel, ModelData>;
27
- readonly #liveLocationPromises: Set<Promise<void|Location|StackTraceTopFrameLocation|null>>;
27
+ readonly #liveLocationPromises: Set<unknown>;
28
28
  readonly pluginManager: DebuggerLanguagePluginManager;
29
29
  readonly ignoreListManager: Workspace.IgnoreListManager.IgnoreListManager;
30
30
  readonly workspace: Workspace.Workspace.WorkspaceImpl;
@@ -154,11 +154,11 @@ export class DebuggerWorkspaceBinding implements SDK.TargetManager.SDKModelObser
154
154
  * The promise returned by this function is resolved once all *currently*
155
155
  * pending LiveLocations are processed.
156
156
  */
157
- async pendingLiveLocationChangesPromise(): Promise<void|Location|StackTraceTopFrameLocation|null> {
157
+ async pendingLiveLocationChangesPromise(): Promise<void> {
158
158
  await Promise.all(this.#liveLocationPromises);
159
159
  }
160
160
 
161
- private recordLiveLocationChange(promise: Promise<void|Location|StackTraceTopFrameLocation|null>): void {
161
+ private recordLiveLocationChange(promise: Promise<unknown>): void {
162
162
  void promise.then(() => {
163
163
  this.#liveLocationPromises.delete(promise);
164
164
  });
@@ -166,10 +166,14 @@ export class DebuggerWorkspaceBinding implements SDK.TargetManager.SDKModelObser
166
166
  }
167
167
 
168
168
  async updateLocations(script: SDK.Script.Script): Promise<void> {
169
- const updatePromises = [script.target()
170
- .model(StackTraceImpl.StackTraceModel.StackTraceModel)
171
- ?.scriptInfoChanged(script, this.#translateRawFrames.bind(this))];
169
+ const stackTraceUpdatePromise = script.target()
170
+ .model(StackTraceImpl.StackTraceModel.StackTraceModel)
171
+ ?.scriptInfoChanged(script, this.#translateRawFrames.bind(this));
172
+ if (stackTraceUpdatePromise) {
173
+ this.recordLiveLocationChange(stackTraceUpdatePromise);
174
+ }
172
175
 
176
+ const updatePromises = [stackTraceUpdatePromise];
173
177
  const modelData = this.#debuggerModelToData.get(script.debuggerModel);
174
178
  if (modelData) {
175
179
  const updatePromise = modelData.updateLocations(script);
@@ -184,7 +188,9 @@ export class DebuggerWorkspaceBinding implements SDK.TargetManager.SDKModelObser
184
188
  Promise<StackTrace.StackTrace.StackTrace> {
185
189
  const model =
186
190
  target.model(StackTraceImpl.StackTraceModel.StackTraceModel) as StackTraceImpl.StackTraceModel.StackTraceModel;
187
- return await model.createFromProtocolRuntime(stackTrace, this.#translateRawFrames.bind(this));
191
+ const stackTracePromise = model.createFromProtocolRuntime(stackTrace, this.#translateRawFrames.bind(this));
192
+ this.recordLiveLocationChange(stackTracePromise);
193
+ return await stackTracePromise;
188
194
  }
189
195
 
190
196
  async createStackTraceFromDebuggerPaused(
@@ -192,7 +198,9 @@ export class DebuggerWorkspaceBinding implements SDK.TargetManager.SDKModelObser
192
198
  target: SDK.Target.Target): Promise<StackTrace.StackTrace.DebuggableStackTrace> {
193
199
  const model =
194
200
  target.model(StackTraceImpl.StackTraceModel.StackTraceModel) as StackTraceImpl.StackTraceModel.StackTraceModel;
195
- return await model.createFromDebuggerPaused(pausedDetails, this.#translateRawFrames.bind(this));
201
+ const stackTracePromise = model.createFromDebuggerPaused(pausedDetails, this.#translateRawFrames.bind(this));
202
+ this.recordLiveLocationChange(stackTracePromise);
203
+ return await stackTracePromise;
196
204
  }
197
205
 
198
206
  async createLiveLocation(
@@ -125,20 +125,33 @@ export class ComputedStyleModel extends Common.ObjectWrapper.ObjectWrapper<Event
125
125
  }
126
126
 
127
127
  if (!this.computedStylePromise) {
128
- this.computedStylePromise = cssModel.getComputedStyle(nodeId).then(verifyOutdated.bind(this, elementNode));
128
+ this.computedStylePromise = cssModel.getComputedStyle(nodeId).then(style => {
129
+ return this.#validateNodeStyles(elementNode, style);
130
+ });
129
131
  }
130
132
 
131
133
  return await this.computedStylePromise;
134
+ }
132
135
 
133
- function verifyOutdated(
134
- this: ComputedStyleModel, elementNode: SDK.DOMModel.DOMNode, style: Map<string, string>|null): ComputedStyle|
135
- null {
136
- return elementNode === this.elementNode() && style ? new ComputedStyle(elementNode, style) :
137
- null as ComputedStyle | null;
136
+ /**
137
+ * Once we fetch the node's CSS styles, we validate them to ensure that the
138
+ * active Node didn't change between initiating the request to fetch the
139
+ * styles and the request returning. If it did, we discard these styles as
140
+ * outdated.
141
+ */
142
+ #validateNodeStyles(node: SDK.DOMModel.DOMNode, styles: Map<string, string>|null): ComputedStyle|null {
143
+ if (node === this.elementNode() && styles) {
144
+ return new ComputedStyle(node, styles);
138
145
  }
146
+ return null;
139
147
  }
140
148
 
141
- private async fetchMatchedCascade(): Promise<SDK.CSSMatchedStyles.CSSMatchedStyles|null> {
149
+ /**
150
+ * Fetches the CSS cascade for the node, including matched rules, inherited
151
+ * styles, and pseudo-elements.
152
+ * This allows determining which properties are active or overridden.
153
+ */
154
+ async fetchMatchedCascade(): Promise<SDK.CSSMatchedStyles.CSSMatchedStyles|null> {
142
155
  const node = this.node;
143
156
  if (!node || !this.cssModel()) {
144
157
  return null;
@@ -155,14 +168,6 @@ export class ComputedStyleModel extends Common.ObjectWrapper.ObjectWrapper<Event
155
168
  }
156
169
  return matchedStyles.node() === this.node ? matchedStyles : null;
157
170
  }
158
-
159
- async fetchAllComputedStyleInfo(): Promise<{
160
- computedStyle: ComputedStyle | null,
161
- matchedStyles: SDK.CSSMatchedStyles.CSSMatchedStyles|null,
162
- }> {
163
- const [computedStyle, matchedStyles] = await Promise.all([this.fetchComputedStyle(), this.fetchMatchedCascade()]);
164
- return {computedStyle, matchedStyles};
165
- }
166
171
  }
167
172
 
168
173
  export const enum Events {
@@ -8,7 +8,6 @@ import * as Root from '../../core/root/root.js';
8
8
  let instance: Prototypes|null = null;
9
9
 
10
10
  export interface GreenDevSettings {
11
- inDevToolsFloaty: Common.Settings.Setting<boolean>;
12
11
  aiAnnotations: Common.Settings.Setting<boolean>;
13
12
  copyToGemini: Common.Settings.Setting<boolean>;
14
13
  }
@@ -36,9 +35,6 @@ export class Prototypes {
36
35
 
37
36
  settings(): Readonly<GreenDevSettings> {
38
37
  const settings = Common.Settings.Settings.instance();
39
- const inDevToolsFloaty =
40
- settings.createSetting('greendev-in-devtools-floaty-enabled', false, Common.Settings.SettingStorageType.LOCAL);
41
-
42
38
  const aiAnnotations = settings.createSetting(
43
39
  'greendev-ai-annotations-enabled',
44
40
  false,
@@ -47,6 +43,6 @@ export class Prototypes {
47
43
  const copyToGemini =
48
44
  settings.createSetting('greendev-copy-to-gemini-enabled', false, Common.Settings.SettingStorageType.LOCAL);
49
45
 
50
- return {inDevToolsFloaty, aiAnnotations, copyToGemini};
46
+ return {aiAnnotations, copyToGemini};
51
47
  }
52
48
  }
@@ -106,14 +106,6 @@ export class CorsIssue extends Issue<Protocol.Audits.CorsIssueDetails, IssueCode
106
106
 
107
107
  getDescription(): MarkdownIssueDescription|null {
108
108
  switch (getIssueCode(this.details())) {
109
- case IssueCode.INSECURE_LOCAL_NETWORK:
110
- return {
111
- file: 'corsInsecurePrivateNetwork.md',
112
- links: [{
113
- link: 'https://developer.chrome.com/blog/private-network-access-update',
114
- linkTitle: i18nString(UIStrings.corsLocalNetworkAccess),
115
- }],
116
- };
117
109
  case IssueCode.INVALID_HEADER_VALUES:
118
110
  return {
119
111
  file: 'corsInvalidHeaderValues.md',
@@ -202,11 +194,12 @@ export class CorsIssue extends Issue<Protocol.Audits.CorsIssueDetails, IssueCode
202
194
  linkTitle: i18nString(UIStrings.CORS),
203
195
  }],
204
196
  };
197
+ case IssueCode.INSECURE_LOCAL_NETWORK:
205
198
  case IssueCode.LOCAL_NETWORK_ACCESS_PERMISSION_DENIED:
206
199
  return {
207
200
  file: 'corsLocalNetworkAccessPermissionDenied.md',
208
201
  links: [{
209
- link: 'https://chromestatus.com/feature/5152728072060928',
202
+ link: 'https://developer.chrome.com/blog/local-network-access',
210
203
  linkTitle: i18nString(UIStrings.corsLocalNetworkAccess),
211
204
  }],
212
205
  };
@@ -1,4 +1,4 @@
1
- # Ensure that local network requests are compatible with upcoming restrictions
1
+ # Ensure that local network requests are compatible with restrictions
2
2
 
3
3
  A site requested a resource from a network that it could only access because of
4
4
  its users' privileged network position.
@@ -6,7 +6,7 @@ its users' privileged network position.
6
6
  These requests expose devices and servers to the internet, increasing the risk
7
7
  of a cross-site request forgery (CSRF) attack and/or information leakage.
8
8
 
9
- To mitigate these risks, Chrome will begin requiring the user grant explicit
9
+ To mitigate these risks, Chrome is requiring the user grant explicit
10
10
  permission before a site can make local network requests. Local network requests
11
11
  are those that go to either private IP addresses, .local domains, or loopback
12
12
  addresses. Additionally, Chrome will block local network requests (both
@@ -6627,6 +6627,22 @@ export const NativeFunctions = [
6627
6627
  name: "setFormControlRange",
6628
6628
  signatures: [["element","start","end"]]
6629
6629
  },
6630
+ {
6631
+ name: "getBoxQuads",
6632
+ signatures: [["?options"]]
6633
+ },
6634
+ {
6635
+ name: "convertQuadFromNode",
6636
+ signatures: [["quad","from","?options"]]
6637
+ },
6638
+ {
6639
+ name: "convertRectFromNode",
6640
+ signatures: [["rect","from","?options"]]
6641
+ },
6642
+ {
6643
+ name: "convertPointFromNode",
6644
+ signatures: [["point","from","?options"]]
6645
+ },
6630
6646
  {
6631
6647
  name: "MutationObserver",
6632
6648
  signatures: [["callback"]]
@@ -7369,6 +7385,10 @@ export const NativeFunctions = [
7369
7385
  name: "createScriptURL",
7370
7386
  signatures: [["input","...args"]]
7371
7387
  },
7388
+ {
7389
+ name: "createParserOptions",
7390
+ signatures: [["input"]]
7391
+ },
7372
7392
  {
7373
7393
  name: "URLPattern",
7374
7394
  signatures: [["?input","?options"],["input","baseURL","?options"]]
@@ -13,7 +13,6 @@ import * as SDK from '../../core/sdk/sdk.js';
13
13
  import * as AiAssistanceModel from '../../models/ai_assistance/ai_assistance.js';
14
14
  import * as Annotations from '../../models/annotations/annotations.js';
15
15
  import * as Badges from '../../models/badges/badges.js';
16
- import * as GreenDev from '../../models/greendev/greendev.js';
17
16
  import * as TextUtils from '../../models/text_utils/text_utils.js';
18
17
  import type * as Trace from '../../models/trace/trace.js';
19
18
  import * as Workspace from '../../models/workspace/workspace.js';
@@ -518,7 +517,6 @@ export class AiAssistancePanel extends UI.Panel.Panel {
518
517
  };
519
518
  #timelinePanelInstance: TimelinePanel.TimelinePanel.TimelinePanel|null = null;
520
519
  #runAbortController = new AbortController();
521
- #additionalContextItemsFromFloaty: UI.Floaty.FloatyContextSelection[] = [];
522
520
 
523
521
  constructor(private view: View = defaultView, {aidaClient, aidaAvailability, syncInfo}: {
524
522
  aidaClient: Host.AidaClient.AidaClient,
@@ -571,7 +569,6 @@ export class AiAssistancePanel extends UI.Panel.Panel {
571
569
  return {
572
570
  state: ViewState.CHAT_VIEW,
573
571
  props: {
574
- additionalFloatyContext: this.#additionalContextItemsFromFloaty,
575
572
  blockedByCrossOrigin: this.#conversation.isBlockedByOrigin,
576
573
  isLoading: this.#isLoading,
577
574
  messages: this.#messages,
@@ -665,15 +662,6 @@ export class AiAssistancePanel extends UI.Panel.Panel {
665
662
  }
666
663
  }
667
664
 
668
- #bindFloatyListener(): void {
669
- const additionalContexts = UI.Context.Context.instance().flavor(UI.Floaty.FloatyFlavor);
670
- if (!additionalContexts) {
671
- return;
672
- }
673
- this.#additionalContextItemsFromFloaty = additionalContexts.selectedContexts;
674
- this.requestUpdate();
675
- }
676
-
677
665
  async #handlePerformanceRecordAndReload(): Promise<Trace.TraceModel.ParsedTrace> {
678
666
  return await TimelinePanel.TimelinePanel.TimelinePanel.executeRecordAndReload();
679
667
  }
@@ -734,7 +722,8 @@ export class AiAssistancePanel extends UI.Panel.Panel {
734
722
  const conversation = targetConversationType ?
735
723
  new AiAssistanceModel.AiConversation.AiConversation(
736
724
  targetConversationType, [], undefined, false, this.#aidaClient, this.#changeManager, false,
737
- this.#handlePerformanceRecordAndReload.bind(this), this.#handleInspectElement.bind(this)) :
725
+ this.#handlePerformanceRecordAndReload.bind(this), this.#handleInspectElement.bind(this),
726
+ NetworkPanel.NetworkPanel.NetworkPanel.instance().networkLogView.timeCalculator()) :
738
727
  undefined;
739
728
 
740
729
  this.#updateConversationState(conversation);
@@ -763,6 +752,7 @@ export class AiAssistancePanel extends UI.Panel.Panel {
763
752
  false,
764
753
  this.#handlePerformanceRecordAndReload.bind(this),
765
754
  this.#handleInspectElement.bind(this),
755
+ NetworkPanel.NetworkPanel.NetworkPanel.instance().networkLogView.timeCalculator(),
766
756
  );
767
757
  }
768
758
  }
@@ -824,11 +814,6 @@ export class AiAssistancePanel extends UI.Panel.Panel {
824
814
  this.#selectDefaultAgentIfNeeded();
825
815
 
826
816
  Host.userMetrics.actionTaken(Host.UserMetrics.Action.AiAssistancePanelOpened);
827
-
828
- if (GreenDev.Prototypes.instance().isEnabled('inDevToolsFloaty')) {
829
- UI.Context.Context.instance().addFlavorChangeListener(UI.Floaty.FloatyFlavor, this.#bindFloatyListener, this);
830
- this.#bindFloatyListener();
831
- }
832
817
  }
833
818
 
834
819
  override willHide(): void {
@@ -1230,6 +1215,7 @@ export class AiAssistancePanel extends UI.Panel.Panel {
1230
1215
  false,
1231
1216
  this.#handlePerformanceRecordAndReload.bind(this),
1232
1217
  this.#handleInspectElement.bind(this),
1218
+ NetworkPanel.NetworkPanel.NetworkPanel.instance().networkLogView.timeCalculator(),
1233
1219
  );
1234
1220
  }
1235
1221
  this.#updateConversationState(conversation);
@@ -1358,23 +1344,14 @@ export class AiAssistancePanel extends UI.Panel.Panel {
1358
1344
  }
1359
1345
 
1360
1346
  #handleConversationContextChange = (data: unknown): void => {
1361
- if (data instanceof Workspace.UISourceCode.UISourceCode) {
1362
- const context = new AiAssistanceModel.FileAgent.FileContext(data);
1363
- this.#selectedFile = context;
1364
- this.#conversation?.setContext(context);
1365
- } else if (data instanceof SDK.DOMModel.DOMNode) {
1366
- const context = new AiAssistanceModel.StylingAgent.NodeContext(data);
1367
- this.#selectedElement = context;
1368
- this.#conversation?.setContext(context);
1369
- } else if (data instanceof SDK.NetworkRequest.NetworkRequest) {
1370
- const calculator = NetworkPanel.NetworkPanel.NetworkPanel.instance().networkLogView.timeCalculator();
1371
- const context = new AiAssistanceModel.NetworkAgent.RequestContext(data, calculator);
1372
- this.#selectedRequest = context;
1373
- this.#conversation?.setContext(context);
1374
- } else if (data instanceof AiAssistanceModel.AIContext.AgentFocus) {
1375
- const context = new AiAssistanceModel.PerformanceAgent.PerformanceTraceContext(data);
1376
- this.#selectedPerformanceTrace = context;
1377
- this.#conversation?.setContext(context);
1347
+ if (data instanceof AiAssistanceModel.FileAgent.FileContext) {
1348
+ this.#selectedFile = data;
1349
+ } else if (data instanceof AiAssistanceModel.StylingAgent.NodeContext) {
1350
+ this.#selectedElement = data;
1351
+ } else if (data instanceof AiAssistanceModel.NetworkAgent.RequestContext) {
1352
+ this.#selectedRequest = data;
1353
+ } else if (data instanceof AiAssistanceModel.PerformanceAgent.PerformanceTraceContext) {
1354
+ this.#selectedPerformanceTrace = data;
1378
1355
  }
1379
1356
 
1380
1357
  this.#isContextAutoSelectionSuspended = false;
@@ -1475,7 +1452,6 @@ export class AiAssistancePanel extends UI.Panel.Panel {
1475
1452
  text,
1476
1453
  {
1477
1454
  signal,
1478
- extraContext: this.#additionalContextItemsFromFloaty,
1479
1455
  multimodalInput,
1480
1456
  },
1481
1457
  ),
@@ -1586,6 +1562,7 @@ export class AiAssistancePanel extends UI.Panel.Panel {
1586
1562
  commitStep();
1587
1563
  break;
1588
1564
  }
1565
+
1589
1566
  case AiAssistanceModel.AiAgent.ResponseType.ANSWER: {
1590
1567
  systemMessage.rpcId = data.rpcId;
1591
1568
  const lastPart = systemMessage.parts.at(-1);