|
5 | 5 | */ |
6 | 6 |
|
7 | 7 | import {logger} from '../logger.js'; |
8 | | -import {DevTools, zod} from '../third_party/index.js'; |
| 8 | +import {zod} from '../third_party/index.js'; |
9 | 9 | import type {Page} from '../third_party/index.js'; |
10 | 10 | import type {InsightName} from '../trace-processing/parse.js'; |
11 | 11 | import { |
@@ -162,39 +162,6 @@ export const analyzeInsight = defineTool({ |
162 | 162 | }, |
163 | 163 | }); |
164 | 164 |
|
165 | | -export const toggleCrux = defineTool({ |
166 | | - name: 'performance_toggle_crux', |
167 | | - description: |
168 | | - 'Enables or disables the fetching of real-user experience data from the Chrome User Experience Report (CrUX) API during performance traces. When enabled, performance summaries will include field data (LCP, INP, CLS) for the URLs in the trace.', |
169 | | - annotations: { |
170 | | - category: ToolCategory.PERFORMANCE, |
171 | | - readOnlyHint: false, |
172 | | - }, |
173 | | - schema: { |
174 | | - enabled: zod |
175 | | - .boolean() |
176 | | - .describe('Whether to enable or disable CrUX data fetching.'), |
177 | | - }, |
178 | | - handler: async (request, response) => { |
179 | | - try { |
180 | | - const settings = DevTools.Common.Settings.Settings.instance(); |
181 | | - const cruxSetting = settings.createSetting( |
182 | | - 'field-data', |
183 | | - {enabled: false}, |
184 | | - DevTools.Common.Settings.SettingStorageType.GLOBAL, |
185 | | - ); |
186 | | - cruxSetting.set({...cruxSetting.get(), enabled: request.params.enabled}); |
187 | | - response.appendResponseLine( |
188 | | - `CrUX data fetching has been ${request.params.enabled ? 'enabled' : 'disabled'}.`, |
189 | | - ); |
190 | | - } catch { |
191 | | - response.appendResponseLine( |
192 | | - 'Error: Could not update the CrUX setting. It might not be available in this environment.', |
193 | | - ); |
194 | | - } |
195 | | - }, |
196 | | -}); |
197 | | - |
198 | 165 | async function stopTracingAndAppendOutput( |
199 | 166 | page: Page, |
200 | 167 | response: Response, |
|
0 commit comments