Skip to content

Commit 8c6208c

Browse files
committed
query all metrics
Change-Id: Ibb753c5420ac89ff43a8fed59b0651e7c4672345
1 parent 9a2d13e commit 8c6208c

File tree

2 files changed

+6
-14
lines changed

2 files changed

+6
-14
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
"start": "npm run build && node build/src/index.js",
1717
"start-debug": "DEBUG=mcp:* DEBUG_COLORS=false npm run build && node build/src/index.js",
1818
"test:node20": "node --require ./build/tests/setup.js --test-reporter spec --test-force-exit --test build/tests",
19-
"test": "npm run build && node --require ./build/tests/setup.js --no-warnings=ExperimentalWarning --test-reporter spec --test-force-exit --test \"build/tests/**/performance.test.js\"",
19+
"test": "npm run build && node --require ./build/tests/setup.js --no-warnings=ExperimentalWarning --test-reporter spec --test-force-exit --test \"build/tests/**/*.test.js\"",
2020
"test:only": "npm run build && node --require ./build/tests/setup.js --no-warnings=ExperimentalWarning --test-reporter spec --test-force-exit --test --test-only \"build/tests/**/*.test.js\"",
2121
"test:only:no-build": "node --require ./build/tests/setup.js --no-warnings=ExperimentalWarning --test-reporter spec --test-force-exit --test --test-only \"build/tests/**/*.test.js\"",
2222
"test:update-snapshots": "npm run build && node --require ./build/tests/setup.js --no-warnings=ExperimentalWarning --test-force-exit --test --test-update-snapshots \"build/tests/**/*.test.js\"",

src/tools/performance.ts

Lines changed: 5 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -228,26 +228,18 @@ export const queryChromeUXReport = defineTool({
228228
return;
229229
}
230230

231-
const body = JSON.stringify({
232-
origin,
233-
url,
234-
formFactor,
235-
metrics: [
236-
'first_contentful_paint',
237-
'largest_contentful_paint',
238-
'cumulative_layout_shift',
239-
'interaction_to_next_paint',
240-
],
241-
});
242-
243231
try {
244232
const cruxResponse = await fetch(CRUX_ENDPOINT, {
245233
method: 'POST',
246234
headers: {
247235
'Content-Type': 'application/json',
248236
referer: 'devtools://mcp',
249237
},
250-
body,
238+
body: JSON.stringify({
239+
origin,
240+
url,
241+
formFactor,
242+
}),
251243
});
252244

253245
const data = await cruxResponse.json();

0 commit comments

Comments
 (0)