Skip to content

Commit 3b1ffd6

Browse files
committed
docs
Change-Id: I00e21d0f39adc99a6a9754dca73ab8f4c1d421ea
1 parent 94bca8d commit 3b1ffd6

File tree

3 files changed

+20
-4
lines changed

3 files changed

+20
-4
lines changed

README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -258,8 +258,9 @@ If you run into any issues, checkout our [troubleshooting guide](./docs/troubles
258258
- [`emulate_cpu`](docs/tool-reference.md#emulate_cpu)
259259
- [`emulate_network`](docs/tool-reference.md#emulate_network)
260260
- [`resize_page`](docs/tool-reference.md#resize_page)
261-
- **Performance** (3 tools)
261+
- **Performance** (4 tools)
262262
- [`performance_analyze_insight`](docs/tool-reference.md#performance_analyze_insight)
263+
- [`performance_query_chrome_ux_report`](docs/tool-reference.md#performance_query_chrome_ux_report)
263264
- [`performance_start_trace`](docs/tool-reference.md#performance_start_trace)
264265
- [`performance_stop_trace`](docs/tool-reference.md#performance_stop_trace)
265266
- **Network** (2 tools)

docs/tool-reference.md

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,9 @@
2222
- [`emulate_cpu`](#emulate_cpu)
2323
- [`emulate_network`](#emulate_network)
2424
- [`resize_page`](#resize_page)
25-
- **[Performance](#performance)** (3 tools)
25+
- **[Performance](#performance)** (4 tools)
2626
- [`performance_analyze_insight`](#performance_analyze_insight)
27+
- [`performance_query_chrome_ux_report`](#performance_query_chrome_ux_report)
2728
- [`performance_start_trace`](#performance_start_trace)
2829
- [`performance_stop_trace`](#performance_stop_trace)
2930
- **[Network](#network)** (2 tools)
@@ -232,6 +233,18 @@
232233

233234
---
234235

236+
### `performance_query_chrome_ux_report`
237+
238+
**Description:** Queries the Chrome UX Report (CrUX) API to get real-user experience metrics (like Core Web Vitals) for a given URL or origin. You must provide EITHER "origin" OR "url", but not both. You can optionally filter by "formFactor".
239+
240+
**Parameters:**
241+
242+
- **formFactor** (enum: "DESKTOP", "PHONE", "TABLET") _(optional)_: The form factor to filter by. If omitted, data for all form factors is aggregated.
243+
- **origin** (string) _(optional)_: The origin to query, e.g., "https://www.google.com". Do not provide this if "url" is specified.
244+
- **url** (string) _(optional)_: The specific page URL to query, e.g., "https://www.google.com/search?q=puppies". Do not provide this if "origin" is specified.
245+
246+
---
247+
235248
### `performance_start_trace`
236249

237250
**Description:** Starts a performance trace recording on the selected page. This can be used to look for performance problems and insights to improve the performance of the page. It will also report Core Web Vital (CWV) scores for the page.
@@ -287,15 +300,16 @@ so returned values have to JSON-serializable.
287300

288301
- **args** (array) _(optional)_: An optional list of arguments to pass to the function.
289302
- **function** (string) **(required)**: A JavaScript function declaration to be executed by the tool in the currently selected page.
290-
Example without arguments: `() => {
303+
Example without arguments: `() => {
291304
return document.title
292305
}` or `async () => {
293306
return await fetch("example.com")
294307
}`.
295-
Example with arguments: `(el) => {
308+
Example with arguments: `(el) => {
296309
return el.innerText;
297310
}`
298311

312+
299313
---
300314

301315
### `get_console_message`

tests/tools/performance.test.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ import {describe, it, afterEach} from 'node:test';
88

99
import sinon from 'sinon';
1010

11+
import type {Context} from '../../src/tools/ToolDefinition.js';
1112
import {
1213
analyzeInsight,
1314
queryChromeUXReport,

0 commit comments

Comments
 (0)