chrome-devtools-frontend 1.0.1632065 → 1.0.1635876

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 (107) hide show
  1. package/front_end/core/host/UserMetrics.ts +5 -2
  2. package/front_end/core/root/ExperimentNames.ts +1 -0
  3. package/front_end/core/root/Runtime.ts +5 -0
  4. package/front_end/core/sdk/SourceMapCache.ts +13 -11
  5. package/front_end/core/sdk/SourceMapManager.ts +7 -3
  6. package/front_end/entrypoints/greendev_floaty/FloatyEntrypoint.ts +84 -22
  7. package/front_end/entrypoints/main/MainImpl.ts +8 -0
  8. package/front_end/generated/InspectorBackendCommands.ts +3 -4
  9. package/front_end/generated/SupportedCSSProperties.js +272 -2
  10. package/front_end/generated/protocol-mapping.d.ts +0 -10
  11. package/front_end/generated/protocol-proxy-api.d.ts +0 -8
  12. package/front_end/generated/protocol.ts +5 -7
  13. package/front_end/models/ai_assistance/AiConversation.ts +16 -11
  14. package/front_end/models/ai_assistance/agents/AccessibilityAgent.ts +13 -2
  15. package/front_end/models/ai_assistance/agents/AiAgent.ts +65 -11
  16. package/front_end/models/ai_assistance/agents/ContextSelectionAgent.ts +42 -2
  17. package/front_end/models/ai_assistance/agents/GreenDevAgent.ts +68 -5
  18. package/front_end/models/ai_assistance/agents/GreenDevAgentAntigravityCliSocketClient.ts +53 -0
  19. package/front_end/models/ai_assistance/agents/GreenDevAgentGeminiCliSocketClient.ts +117 -0
  20. package/front_end/models/ai_assistance/agents/PerformanceAgent.ts +30 -1
  21. package/front_end/models/ai_assistance/ai_assistance.ts +4 -0
  22. package/front_end/models/ai_assistance/data_formatters/PerformanceInsightFormatter.ts +4 -2
  23. package/front_end/models/ai_assistance/data_formatters/PerformanceTraceFormatter.ts +5 -2
  24. package/front_end/models/extensions/RecorderExtensionEndpoint.ts +9 -1
  25. package/front_end/models/extensions/RecorderPluginManager.ts +1 -0
  26. package/front_end/models/greendev/Prototypes.ts +17 -5
  27. package/front_end/models/trace/handlers/FramesHandler.ts +19 -13
  28. package/front_end/panels/ai_assistance/components/AccessibilityAgentMarkdownRenderer.ts +3 -0
  29. package/front_end/panels/ai_assistance/components/ChatInput.ts +4 -2
  30. package/front_end/panels/ai_assistance/components/ChatMessage.ts +3 -1
  31. package/front_end/panels/application/preloading/components/PreloadingString.ts +0 -8
  32. package/front_end/panels/common/ExtensionServer.ts +34 -11
  33. package/front_end/panels/elements/CSSRuleValidator.ts +37 -34
  34. package/front_end/panels/elements/CSSRuleValidatorHelper.ts +8 -6
  35. package/front_end/panels/elements/ElementsTreeElement.ts +8 -2
  36. package/front_end/panels/elements/components/CSSHintDetailsView.ts +5 -5
  37. package/front_end/panels/js_timeline/js_timeline-meta.ts +30 -0
  38. package/front_end/panels/protocol_monitor/JSONEditor.ts +4 -4
  39. package/front_end/panels/protocol_monitor/ProtocolMonitor.ts +2 -2
  40. package/front_end/panels/recorder/RecorderController.ts +50 -1
  41. package/front_end/panels/recorder/extensions/ExtensionManager.ts +1 -0
  42. package/front_end/panels/recorder/models/RecordingPlayer.ts +12 -3
  43. package/front_end/panels/recorder/testing/RecorderHelpers.ts +2 -0
  44. package/front_end/panels/settings/SettingsScreen.ts +3 -2
  45. package/front_end/panels/sources/FilteredUISourceCodeListProvider.ts +5 -2
  46. package/front_end/panels/timeline/timeline-meta.ts +10 -6
  47. package/front_end/panels/whats_new/ReleaseNoteText.ts +9 -9
  48. package/front_end/panels/whats_new/resources/WNDT.md +9 -9
  49. package/front_end/third_party/chromium/README.chromium +1 -1
  50. package/front_end/third_party/puppeteer/README.chromium +2 -2
  51. package/front_end/third_party/puppeteer/package/lib/es5-iife/puppeteer-core-browser.d.ts +8 -5
  52. package/front_end/third_party/puppeteer/package/lib/es5-iife/puppeteer-core-browser.js +35 -33
  53. package/front_end/third_party/puppeteer/package/lib/puppeteer/cdp/TargetManager.d.ts.map +1 -1
  54. package/front_end/third_party/puppeteer/package/lib/puppeteer/cdp/TargetManager.js +0 -1
  55. package/front_end/third_party/puppeteer/package/lib/puppeteer/cdp/TargetManager.js.map +1 -1
  56. package/front_end/third_party/puppeteer/package/lib/puppeteer/cdp/WebMCP.d.ts.map +1 -1
  57. package/front_end/third_party/puppeteer/package/lib/puppeteer/cdp/WebMCP.js +0 -3
  58. package/front_end/third_party/puppeteer/package/lib/puppeteer/cdp/WebMCP.js.map +1 -1
  59. package/front_end/third_party/puppeteer/package/lib/puppeteer/common/Debug.d.ts +8 -8
  60. package/front_end/third_party/puppeteer/package/lib/puppeteer/common/Debug.d.ts.map +1 -1
  61. package/front_end/third_party/puppeteer/package/lib/puppeteer/common/Debug.js +8 -8
  62. package/front_end/third_party/puppeteer/package/lib/puppeteer/common/Debug.js.map +1 -1
  63. package/front_end/third_party/puppeteer/package/lib/puppeteer/generated/injected.d.ts +1 -1
  64. package/front_end/third_party/puppeteer/package/lib/puppeteer/generated/injected.d.ts.map +1 -1
  65. package/front_end/third_party/puppeteer/package/lib/puppeteer/generated/injected.js +1 -1
  66. package/front_end/third_party/puppeteer/package/lib/puppeteer/generated/injected.js.map +1 -1
  67. package/front_end/third_party/puppeteer/package/lib/puppeteer/injected/CustomQuerySelector.d.ts +2 -2
  68. package/front_end/third_party/puppeteer/package/lib/puppeteer/injected/CustomQuerySelector.d.ts.map +1 -1
  69. package/front_end/third_party/puppeteer/package/lib/puppeteer/injected/CustomQuerySelector.js +2 -1
  70. package/front_end/third_party/puppeteer/package/lib/puppeteer/injected/CustomQuerySelector.js.map +1 -1
  71. package/front_end/third_party/puppeteer/package/lib/puppeteer/injected/injected.d.ts +2 -7
  72. package/front_end/third_party/puppeteer/package/lib/puppeteer/injected/injected.d.ts.map +1 -1
  73. package/front_end/third_party/puppeteer/package/lib/puppeteer/node/PuppeteerNode.d.ts +1 -1
  74. package/front_end/third_party/puppeteer/package/lib/puppeteer/node/PuppeteerNode.js +1 -1
  75. package/front_end/third_party/puppeteer/package/lib/puppeteer/revisions.d.ts +3 -3
  76. package/front_end/third_party/puppeteer/package/lib/puppeteer/revisions.js +3 -3
  77. package/front_end/third_party/puppeteer/package/lib/puppeteer/revisions.js.map +1 -1
  78. package/front_end/third_party/puppeteer/package/lib/puppeteer/util/Mutex.d.ts +10 -7
  79. package/front_end/third_party/puppeteer/package/lib/puppeteer/util/Mutex.d.ts.map +1 -1
  80. package/front_end/third_party/puppeteer/package/lib/puppeteer/util/Mutex.js +16 -12
  81. package/front_end/third_party/puppeteer/package/lib/puppeteer/util/Mutex.js.map +1 -1
  82. package/front_end/third_party/puppeteer/package/lib/puppeteer/util/version.d.ts +1 -1
  83. package/front_end/third_party/puppeteer/package/lib/puppeteer/util/version.js +1 -1
  84. package/front_end/third_party/puppeteer/package/lib/types.d.ts +8 -5
  85. package/front_end/third_party/puppeteer/package/package.json +5 -7
  86. package/front_end/third_party/puppeteer/package/src/cdp/TargetManager.ts +0 -1
  87. package/front_end/third_party/puppeteer/package/src/cdp/WebMCP.ts +0 -3
  88. package/front_end/third_party/puppeteer/package/src/common/Debug.ts +11 -11
  89. package/front_end/third_party/puppeteer/package/src/generated/injected.ts +1 -1
  90. package/front_end/third_party/puppeteer/package/src/injected/CustomQuerySelector.ts +3 -2
  91. package/front_end/third_party/puppeteer/package/src/node/PuppeteerNode.ts +1 -1
  92. package/front_end/third_party/puppeteer/package/src/revisions.ts +3 -3
  93. package/front_end/third_party/puppeteer/package/src/util/Mutex.ts +17 -12
  94. package/front_end/third_party/puppeteer/package/src/util/version.ts +1 -1
  95. package/front_end/ui/components/markdown_view/MarkdownLinksMap.ts +7 -0
  96. package/front_end/ui/legacy/InspectorDrawerView.ts +2 -1
  97. package/front_end/ui/legacy/InspectorView.ts +1 -1
  98. package/front_end/ui/legacy/PlusButton.ts +269 -0
  99. package/front_end/ui/legacy/ViewManager.ts +38 -11
  100. package/front_end/ui/legacy/components/source_frame/FontView.ts +11 -3
  101. package/front_end/ui/legacy/components/source_frame/ImageView.ts +16 -0
  102. package/front_end/ui/legacy/components/source_frame/imageView.css +13 -0
  103. package/front_end/ui/legacy/components/utils/Linkifier.ts +1 -1
  104. package/front_end/ui/legacy/legacy.ts +2 -0
  105. package/front_end/ui/visual_logging/KnownContextValues.ts +21 -0
  106. package/mcp/mcp.ts +1 -1
  107. package/package.json +1 -10
@@ -667,6 +667,7 @@ export const generatedProperties = [
667
667
  "rx",
668
668
  "ry",
669
669
  "scale",
670
+ "scroll-axis-lock",
670
671
  "scroll-behavior",
671
672
  "scroll-initial-target",
672
673
  "scroll-margin-block-end",
@@ -1967,6 +1968,18 @@ export const generatedProperties = [
1967
1968
  ],
1968
1969
  "name": "corner"
1969
1970
  },
1971
+ {
1972
+ "keywords": [
1973
+ "normal"
1974
+ ],
1975
+ "longhands": [
1976
+ "border-end-start-radius",
1977
+ "corner-end-start-shape",
1978
+ "border-end-end-radius",
1979
+ "corner-end-end-shape"
1980
+ ],
1981
+ "name": "corner-block-end"
1982
+ },
1970
1983
  {
1971
1984
  "longhands": [
1972
1985
  "corner-end-start-shape",
@@ -1974,6 +1987,18 @@ export const generatedProperties = [
1974
1987
  ],
1975
1988
  "name": "corner-block-end-shape"
1976
1989
  },
1990
+ {
1991
+ "keywords": [
1992
+ "normal"
1993
+ ],
1994
+ "longhands": [
1995
+ "border-start-start-radius",
1996
+ "corner-start-start-shape",
1997
+ "border-start-end-radius",
1998
+ "corner-start-end-shape"
1999
+ ],
2000
+ "name": "corner-block-start"
2001
+ },
1977
2002
  {
1978
2003
  "longhands": [
1979
2004
  "corner-start-start-shape",
@@ -1981,6 +2006,28 @@ export const generatedProperties = [
1981
2006
  ],
1982
2007
  "name": "corner-block-start-shape"
1983
2008
  },
2009
+ {
2010
+ "keywords": [
2011
+ "normal"
2012
+ ],
2013
+ "longhands": [
2014
+ "border-bottom-left-radius",
2015
+ "corner-bottom-left-shape",
2016
+ "border-bottom-right-radius",
2017
+ "corner-bottom-right-shape"
2018
+ ],
2019
+ "name": "corner-bottom"
2020
+ },
2021
+ {
2022
+ "keywords": [
2023
+ "normal"
2024
+ ],
2025
+ "longhands": [
2026
+ "border-bottom-left-radius",
2027
+ "corner-bottom-left-shape"
2028
+ ],
2029
+ "name": "corner-bottom-left"
2030
+ },
1984
2031
  {
1985
2032
  "keywords": [
1986
2033
  "notch",
@@ -1992,6 +2039,16 @@ export const generatedProperties = [
1992
2039
  ],
1993
2040
  "name": "corner-bottom-left-shape"
1994
2041
  },
2042
+ {
2043
+ "keywords": [
2044
+ "normal"
2045
+ ],
2046
+ "longhands": [
2047
+ "border-bottom-right-radius",
2048
+ "corner-bottom-right-shape"
2049
+ ],
2050
+ "name": "corner-bottom-right"
2051
+ },
1995
2052
  {
1996
2053
  "keywords": [
1997
2054
  "notch",
@@ -2010,12 +2067,44 @@ export const generatedProperties = [
2010
2067
  ],
2011
2068
  "name": "corner-bottom-shape"
2012
2069
  },
2070
+ {
2071
+ "keywords": [
2072
+ "normal"
2073
+ ],
2074
+ "longhands": [
2075
+ "border-end-end-radius",
2076
+ "corner-end-end-shape"
2077
+ ],
2078
+ "name": "corner-end-end"
2079
+ },
2013
2080
  {
2014
2081
  "name": "corner-end-end-shape"
2015
2082
  },
2083
+ {
2084
+ "keywords": [
2085
+ "normal"
2086
+ ],
2087
+ "longhands": [
2088
+ "border-end-start-radius",
2089
+ "corner-end-start-shape"
2090
+ ],
2091
+ "name": "corner-end-start"
2092
+ },
2016
2093
  {
2017
2094
  "name": "corner-end-start-shape"
2018
2095
  },
2096
+ {
2097
+ "keywords": [
2098
+ "normal"
2099
+ ],
2100
+ "longhands": [
2101
+ "border-start-end-radius",
2102
+ "corner-start-end-shape",
2103
+ "border-end-end-radius",
2104
+ "corner-end-end-shape"
2105
+ ],
2106
+ "name": "corner-inline-end"
2107
+ },
2019
2108
  {
2020
2109
  "longhands": [
2021
2110
  "corner-start-end-shape",
@@ -2023,6 +2112,18 @@ export const generatedProperties = [
2023
2112
  ],
2024
2113
  "name": "corner-inline-end-shape"
2025
2114
  },
2115
+ {
2116
+ "keywords": [
2117
+ "normal"
2118
+ ],
2119
+ "longhands": [
2120
+ "border-start-start-radius",
2121
+ "corner-start-start-shape",
2122
+ "border-end-start-radius",
2123
+ "corner-end-start-shape"
2124
+ ],
2125
+ "name": "corner-inline-start"
2126
+ },
2026
2127
  {
2027
2128
  "longhands": [
2028
2129
  "corner-start-start-shape",
@@ -2030,6 +2131,18 @@ export const generatedProperties = [
2030
2131
  ],
2031
2132
  "name": "corner-inline-start-shape"
2032
2133
  },
2134
+ {
2135
+ "keywords": [
2136
+ "normal"
2137
+ ],
2138
+ "longhands": [
2139
+ "border-top-left-radius",
2140
+ "corner-top-left-shape",
2141
+ "border-bottom-left-radius",
2142
+ "corner-bottom-left-shape"
2143
+ ],
2144
+ "name": "corner-left"
2145
+ },
2033
2146
  {
2034
2147
  "longhands": [
2035
2148
  "corner-top-left-shape",
@@ -2037,6 +2150,18 @@ export const generatedProperties = [
2037
2150
  ],
2038
2151
  "name": "corner-left-shape"
2039
2152
  },
2153
+ {
2154
+ "keywords": [
2155
+ "normal"
2156
+ ],
2157
+ "longhands": [
2158
+ "border-top-right-radius",
2159
+ "corner-top-right-shape",
2160
+ "border-bottom-right-radius",
2161
+ "corner-bottom-right-shape"
2162
+ ],
2163
+ "name": "corner-right"
2164
+ },
2040
2165
  {
2041
2166
  "longhands": [
2042
2167
  "corner-top-right-shape",
@@ -2053,12 +2178,54 @@ export const generatedProperties = [
2053
2178
  ],
2054
2179
  "name": "corner-shape"
2055
2180
  },
2181
+ {
2182
+ "keywords": [
2183
+ "normal"
2184
+ ],
2185
+ "longhands": [
2186
+ "border-start-end-radius",
2187
+ "corner-start-end-shape"
2188
+ ],
2189
+ "name": "corner-start-end"
2190
+ },
2056
2191
  {
2057
2192
  "name": "corner-start-end-shape"
2058
2193
  },
2194
+ {
2195
+ "keywords": [
2196
+ "normal"
2197
+ ],
2198
+ "longhands": [
2199
+ "border-start-start-radius",
2200
+ "corner-start-start-shape"
2201
+ ],
2202
+ "name": "corner-start-start"
2203
+ },
2059
2204
  {
2060
2205
  "name": "corner-start-start-shape"
2061
2206
  },
2207
+ {
2208
+ "keywords": [
2209
+ "normal"
2210
+ ],
2211
+ "longhands": [
2212
+ "border-top-left-radius",
2213
+ "corner-top-left-shape",
2214
+ "border-top-right-radius",
2215
+ "corner-top-right-shape"
2216
+ ],
2217
+ "name": "corner-top"
2218
+ },
2219
+ {
2220
+ "keywords": [
2221
+ "normal"
2222
+ ],
2223
+ "longhands": [
2224
+ "border-top-left-radius",
2225
+ "corner-top-left-shape"
2226
+ ],
2227
+ "name": "corner-top-left"
2228
+ },
2062
2229
  {
2063
2230
  "keywords": [
2064
2231
  "notch",
@@ -2070,6 +2237,16 @@ export const generatedProperties = [
2070
2237
  ],
2071
2238
  "name": "corner-top-left-shape"
2072
2239
  },
2240
+ {
2241
+ "keywords": [
2242
+ "normal"
2243
+ ],
2244
+ "longhands": [
2245
+ "border-top-right-radius",
2246
+ "corner-top-right-shape"
2247
+ ],
2248
+ "name": "corner-top-right"
2249
+ },
2073
2250
  {
2074
2251
  "keywords": [
2075
2252
  "notch",
@@ -3246,7 +3423,7 @@ export const generatedProperties = [
3246
3423
  },
3247
3424
  {
3248
3425
  "keywords": [
3249
- "none"
3426
+ "auto"
3250
3427
  ],
3251
3428
  "name": "max-lines"
3252
3429
  },
@@ -4080,6 +4257,13 @@ export const generatedProperties = [
4080
4257
  {
4081
4258
  "name": "scale"
4082
4259
  },
4260
+ {
4261
+ "keywords": [
4262
+ "auto",
4263
+ "none"
4264
+ ],
4265
+ "name": "scroll-axis-lock"
4266
+ },
4083
4267
  {
4084
4268
  "keywords": [
4085
4269
  "auto",
@@ -5777,6 +5961,26 @@ export const generatedPropertyValues = {
5777
5961
  "normal"
5778
5962
  ]
5779
5963
  },
5964
+ "corner-block-end": {
5965
+ "values": [
5966
+ "normal"
5967
+ ]
5968
+ },
5969
+ "corner-block-start": {
5970
+ "values": [
5971
+ "normal"
5972
+ ]
5973
+ },
5974
+ "corner-bottom": {
5975
+ "values": [
5976
+ "normal"
5977
+ ]
5978
+ },
5979
+ "corner-bottom-left": {
5980
+ "values": [
5981
+ "normal"
5982
+ ]
5983
+ },
5780
5984
  "corner-bottom-left-shape": {
5781
5985
  "values": [
5782
5986
  "notch",
@@ -5787,6 +5991,11 @@ export const generatedPropertyValues = {
5787
5991
  "square"
5788
5992
  ]
5789
5993
  },
5994
+ "corner-bottom-right": {
5995
+ "values": [
5996
+ "normal"
5997
+ ]
5998
+ },
5790
5999
  "corner-bottom-right-shape": {
5791
6000
  "values": [
5792
6001
  "notch",
@@ -5797,6 +6006,56 @@ export const generatedPropertyValues = {
5797
6006
  "square"
5798
6007
  ]
5799
6008
  },
6009
+ "corner-end-end": {
6010
+ "values": [
6011
+ "normal"
6012
+ ]
6013
+ },
6014
+ "corner-end-start": {
6015
+ "values": [
6016
+ "normal"
6017
+ ]
6018
+ },
6019
+ "corner-inline-end": {
6020
+ "values": [
6021
+ "normal"
6022
+ ]
6023
+ },
6024
+ "corner-inline-start": {
6025
+ "values": [
6026
+ "normal"
6027
+ ]
6028
+ },
6029
+ "corner-left": {
6030
+ "values": [
6031
+ "normal"
6032
+ ]
6033
+ },
6034
+ "corner-right": {
6035
+ "values": [
6036
+ "normal"
6037
+ ]
6038
+ },
6039
+ "corner-start-end": {
6040
+ "values": [
6041
+ "normal"
6042
+ ]
6043
+ },
6044
+ "corner-start-start": {
6045
+ "values": [
6046
+ "normal"
6047
+ ]
6048
+ },
6049
+ "corner-top": {
6050
+ "values": [
6051
+ "normal"
6052
+ ]
6053
+ },
6054
+ "corner-top-left": {
6055
+ "values": [
6056
+ "normal"
6057
+ ]
6058
+ },
5800
6059
  "corner-top-left-shape": {
5801
6060
  "values": [
5802
6061
  "notch",
@@ -5807,6 +6066,11 @@ export const generatedPropertyValues = {
5807
6066
  "square"
5808
6067
  ]
5809
6068
  },
6069
+ "corner-top-right": {
6070
+ "values": [
6071
+ "normal"
6072
+ ]
6073
+ },
5810
6074
  "corner-top-right-shape": {
5811
6075
  "values": [
5812
6076
  "notch",
@@ -6505,7 +6769,7 @@ export const generatedPropertyValues = {
6505
6769
  },
6506
6770
  "max-lines": {
6507
6771
  "values": [
6508
- "none"
6772
+ "auto"
6509
6773
  ]
6510
6774
  },
6511
6775
  "max-width": {
@@ -6910,6 +7174,12 @@ export const generatedPropertyValues = {
6910
7174
  "auto"
6911
7175
  ]
6912
7176
  },
7177
+ "scroll-axis-lock": {
7178
+ "values": [
7179
+ "auto",
7180
+ "none"
7181
+ ]
7182
+ },
6913
7183
  "scroll-behavior": {
6914
7184
  "values": [
6915
7185
  "auto",
@@ -2660,7 +2660,6 @@ export namespace ProtocolMapping {
2660
2660
  returnType: void;
2661
2661
  };
2662
2662
  /**
2663
- * TODO: OBSOLETE: To remove when setPressureDataOverride is merged.
2664
2663
  * Provides a given pressure state that will be processed and eventually be
2665
2664
  * delivered to PressureObserver users. |source| must have been previously
2666
2665
  * overridden by setPressureSourceOverrideEnabled.
@@ -2669,15 +2668,6 @@ export namespace ProtocolMapping {
2669
2668
  paramsType: [Protocol.Emulation.SetPressureStateOverrideRequest];
2670
2669
  returnType: void;
2671
2670
  };
2672
- /**
2673
- * Provides a given pressure data set that will be processed and eventually be
2674
- * delivered to PressureObserver users. |source| must have been previously
2675
- * overridden by setPressureSourceOverrideEnabled.
2676
- */
2677
- 'Emulation.setPressureDataOverride': {
2678
- paramsType: [Protocol.Emulation.SetPressureDataOverrideRequest];
2679
- returnType: void;
2680
- };
2681
2671
  /**
2682
2672
  * Overrides the Idle state.
2683
2673
  */
@@ -1762,20 +1762,12 @@ declare namespace ProtocolProxyApi {
1762
1762
  invoke_setPressureSourceOverrideEnabled(params: Protocol.Emulation.SetPressureSourceOverrideEnabledRequest): Promise<Protocol.ProtocolResponseWithError>;
1763
1763
 
1764
1764
  /**
1765
- * TODO: OBSOLETE: To remove when setPressureDataOverride is merged.
1766
1765
  * Provides a given pressure state that will be processed and eventually be
1767
1766
  * delivered to PressureObserver users. |source| must have been previously
1768
1767
  * overridden by setPressureSourceOverrideEnabled.
1769
1768
  */
1770
1769
  invoke_setPressureStateOverride(params: Protocol.Emulation.SetPressureStateOverrideRequest): Promise<Protocol.ProtocolResponseWithError>;
1771
1770
 
1772
- /**
1773
- * Provides a given pressure data set that will be processed and eventually be
1774
- * delivered to PressureObserver users. |source| must have been previously
1775
- * overridden by setPressureSourceOverrideEnabled.
1776
- */
1777
- invoke_setPressureDataOverride(params: Protocol.Emulation.SetPressureDataOverrideRequest): Promise<Protocol.ProtocolResponseWithError>;
1778
-
1779
1771
  /**
1780
1772
  * Overrides the Idle state.
1781
1773
  */
@@ -7395,12 +7395,6 @@ export namespace Emulation {
7395
7395
  state: PressureState;
7396
7396
  }
7397
7397
 
7398
- export interface SetPressureDataOverrideRequest {
7399
- source: PressureSource;
7400
- state: PressureState;
7401
- ownContributionEstimate?: number;
7402
- }
7403
-
7404
7398
  export interface SetIdleOverrideRequest {
7405
7399
  /**
7406
7400
  * Mock isUserActive
@@ -17136,7 +17130,6 @@ export namespace Preload {
17136
17130
  PrefetchResponseUsed = 'PrefetchResponseUsed',
17137
17131
  PrefetchSuccessfulButNotUsed = 'PrefetchSuccessfulButNotUsed',
17138
17132
  PrefetchNotUsedProbeFailed = 'PrefetchNotUsedProbeFailed',
17139
- PrefetchCancelledOnUserNavigation = 'PrefetchCancelledOnUserNavigation',
17140
17133
  }
17141
17134
 
17142
17135
  /**
@@ -19100,6 +19093,11 @@ export namespace Target {
19100
19093
  * the type of "page", this may be set to "prerender".
19101
19094
  */
19102
19095
  subtype?: string;
19096
+ /**
19097
+ * Embedder-specific target metadata. This is only set for targets of
19098
+ * type "tab".
19099
+ */
19100
+ embedderData?: any;
19103
19101
  }
19104
19102
 
19105
19103
  /**
@@ -429,16 +429,7 @@ export class AiConversation {
429
429
  throw new Error('cross-origin context data should not be included');
430
430
  }
431
431
 
432
- const userQuery: UserQuery = {
433
- type: ResponseType.USER_QUERY,
434
- query: initialQuery,
435
- imageInput: options.multimodalInput?.input,
436
- imageId: options.multimodalInput?.id,
437
- };
438
- void this.addHistoryItem(userQuery);
439
- yield userQuery;
440
-
441
- yield* this.#runAgent(initialQuery, options);
432
+ yield* this.#runAgent(initialQuery, options, {isInitialCall: true});
442
433
  } finally {
443
434
  targetManager.removeModelListener(
444
435
  SDK.ResourceTreeModel.ResourceTreeModel, SDK.ResourceTreeModel.Events.PrimaryPageChanged, listener, this);
@@ -456,6 +447,7 @@ export class AiConversation {
456
447
  signal?: AbortSignal,
457
448
  multimodalInput?: MultimodalInput,
458
449
  } = {},
450
+ runOptions: {isInitialCall?: boolean} = {},
459
451
  ): AsyncGenerator<ResponseData, void, void> {
460
452
  this.#setOriginIfEmpty(this.selectedContext?.getOrigin());
461
453
  if (this.isBlockedByOrigin) {
@@ -466,6 +458,17 @@ export class AiConversation {
466
458
  return;
467
459
  }
468
460
 
461
+ if (runOptions.isInitialCall) {
462
+ const userQuery: UserQuery = {
463
+ type: ResponseType.USER_QUERY,
464
+ query: initialQuery,
465
+ imageInput: options.multimodalInput?.input,
466
+ imageId: options.multimodalInput?.id,
467
+ };
468
+ void this.addHistoryItem(userQuery);
469
+ yield userQuery;
470
+ }
471
+
469
472
  function shouldAddToHistory(data: ResponseData): boolean {
470
473
  if (data.type === ResponseType.CONTEXT_CHANGE) {
471
474
  return false;
@@ -499,7 +502,9 @@ export class AiConversation {
499
502
  // requery with the specialized agent.
500
503
  if (data.type === ResponseType.CONTEXT_CHANGE) {
501
504
  this.setContext(data.context);
502
- yield* this.#runAgent(this.#getQueryAfterSelection(initialQuery, data.description), options);
505
+ yield*
506
+ this.#runAgent(
507
+ this.#getQueryAfterSelection(initialQuery, data.description), options, {isInitialCall: false});
503
508
  return;
504
509
  }
505
510
  }
@@ -236,7 +236,18 @@ export class AccessibilityAgent extends AiAgent<LHModel.ReporterTypes.ReportJSON
236
236
  if (!nodeId) {
237
237
  return null;
238
238
  }
239
- return domModel.nodeForId(nodeId);
239
+ const node = domModel.nodeForId(nodeId);
240
+ if (!node) {
241
+ return null;
242
+ }
243
+
244
+ const resourceTreeModel = target.model(SDK.ResourceTreeModel.ResourceTreeModel);
245
+ const mainFrameId = resourceTreeModel?.mainFrame?.id;
246
+ if (node.frameId() !== mainFrameId) {
247
+ return null;
248
+ }
249
+
250
+ return node;
240
251
  }
241
252
 
242
253
  #declareFunctions(): void {
@@ -281,7 +292,7 @@ export class AccessibilityAgent extends AiAgent<LHModel.ReporterTypes.ReportJSON
281
292
  const audits = new LighthouseFormatter().audits(report, 'accessibility');
282
293
  return {
283
294
  result: {audits},
284
- widgets: [{name: 'LIGHTHOUSE_REPORT', data: {report}}],
295
+ widgets: [{name: 'LIGHTHOUSE_REPORT', data: {report, snapshotReport: true}}],
285
296
  };
286
297
  }
287
298
  });
@@ -13,6 +13,8 @@ import type * as Trace from '../../trace/trace.js';
13
13
  import type * as Workspace from '../../workspace/workspace.js';
14
14
  import {debugLog, isStructuredLogEnabled} from '../debug.js';
15
15
 
16
+ const MAX_SUGGESTION_LENGTH = 200;
17
+
16
18
  export const enum ResponseType {
17
19
  CONTEXT = 'context',
18
20
  TITLE = 'title',
@@ -35,6 +37,21 @@ export const enum ErrorType {
35
37
  CROSS_ORIGIN = 'cross-origin'
36
38
  }
37
39
 
40
+ /**
41
+ * Returns true if the origin is considered opaque and should be blocked from
42
+ * AI assistance to prevent potential data leakage.
43
+ *
44
+ * @see https://crbug.com/513732588
45
+ */
46
+ export function isOpaqueOrigin(origin: string): boolean {
47
+ /**
48
+ * Origins starting with 'about' (like about:blank or about:srcdoc) are
49
+ * considered opaque. 'about://' is the sentinel used by DevTools
50
+ * ParsedURL.securityOrigin() for these.
51
+ */
52
+ return origin === 'null' || origin === 'data:' || origin.startsWith('about') || origin.startsWith('detached');
53
+ }
54
+
38
55
  export const enum MultimodalInputType {
39
56
  SCREENSHOT = 'screenshot',
40
57
  UPLOADED_IMAGE = 'uploaded-image',
@@ -185,15 +202,30 @@ export abstract class ConversationContext<T> {
185
202
  abstract getItem(): T;
186
203
  abstract getTitle(): string;
187
204
 
188
- isOriginAllowed(agentOrigin: string|undefined): boolean {
189
- if (!agentOrigin) {
205
+ /**
206
+ * Returns true if this data context (e.g., a DOM node or Network Request) is
207
+ * allowed to be included in a conversation that is locked to the provided
208
+ * `establishedOrigin`.
209
+ *
210
+ * A conversation is "locked" to an origin once the first query is made.
211
+ * This method ensures that we don't mix data from different origins in the
212
+ * same conversation.
213
+ *
214
+ * @param establishedOrigin The origin that the current conversation is locked to.
215
+ * If undefined, the conversation has not yet been locked to an origin.
216
+ */
217
+ isOriginAllowed(establishedOrigin: string|undefined): boolean {
218
+ const dataOrigin = this.getOrigin();
219
+ // Opaque origins are never allowed to be used as context.
220
+ if (isOpaqueOrigin(dataOrigin)) {
221
+ return false;
222
+ }
223
+ // If no origin is established yet, this context will be the one to lock the conversation.
224
+ if (!establishedOrigin) {
190
225
  return true;
191
226
  }
192
- // Currently does not handle opaque origins because they
193
- // are not available to DevTools, instead checks
194
- // that serialization of the origin is the same
195
- // https://html.spec.whatwg.org/#ascii-serialisation-of-an-origin.
196
- return this.getOrigin() === agentOrigin;
227
+ // Only allow data that matches the origin the conversation is already locked to.
228
+ return dataOrigin === establishedOrigin;
197
229
  }
198
230
 
199
231
  /**
@@ -294,6 +326,7 @@ export interface LighthouseReportAiWidget {
294
326
  name: 'LIGHTHOUSE_REPORT';
295
327
  data: {
296
328
  report: LHModel.ReporterTypes.ReportJSON,
329
+ snapshotReport?: boolean,
297
330
  };
298
331
  }
299
332
 
@@ -545,8 +578,7 @@ export abstract class AiAgent<T> {
545
578
  const trimmed = line.trim();
546
579
  if (trimmed.startsWith('SUGGESTIONS:')) {
547
580
  try {
548
- // TODO: Do basic validation this is an array with strings
549
- suggestions = JSON.parse(trimmed.substring('SUGGESTIONS:'.length).trim());
581
+ suggestions = sanitizeSuggestions(trimmed.substring('SUGGESTIONS:'.length).trim());
550
582
  } catch {
551
583
  }
552
584
  } else {
@@ -559,8 +591,7 @@ export abstract class AiAgent<T> {
559
591
  if (!suggestions && answerLines.at(-1)?.includes('SUGGESTIONS:')) {
560
592
  const [answer, suggestionsText] = answerLines[answerLines.length - 1].split('SUGGESTIONS:', 2);
561
593
  try {
562
- // TODO: Do basic validation this is an array with strings
563
- suggestions = JSON.parse(suggestionsText.trim().substring('SUGGESTIONS:'.length).trim());
594
+ suggestions = sanitizeSuggestions(suggestionsText.trim());
564
595
  } catch {
565
596
  }
566
597
  answerLines[answerLines.length - 1] = answer;
@@ -967,3 +998,26 @@ export abstract class AiAgent<T> {
967
998
  };
968
999
  }
969
1000
  }
1001
+
1002
+ function sanitizeSuggestions(suggestions: string): [string, ...string[]]|undefined {
1003
+ const parsed = JSON.parse(suggestions);
1004
+ if (!Array.isArray(parsed)) {
1005
+ return undefined;
1006
+ }
1007
+ const sanitized: string[] = [];
1008
+ for (const item of parsed) {
1009
+ if (typeof item !== 'string') {
1010
+ continue;
1011
+ }
1012
+ // Collapse multiple whitespace/newlines into a single space.
1013
+ const noExtraWhitespace = item.replace(/\s+/g, ' ').trim();
1014
+ if (noExtraWhitespace.length === 0) {
1015
+ continue;
1016
+ }
1017
+ sanitized.push(noExtraWhitespace.substring(0, MAX_SUGGESTION_LENGTH));
1018
+ }
1019
+ if (sanitized.length === 0) {
1020
+ return undefined;
1021
+ }
1022
+ return sanitized as [string, ...string[]];
1023
+ }