You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
refactor: replace isolatedContext routing with pageId routing
Replace the isolatedContext-based page resolution with the more general
pageId parameter. The isolatedContext approach only worked when agents
used different browser contexts. pageId works for any multi-page
scenario, uses an already-existing concept (page IDs), and does not
depend on isolated contexts.
- Rename isolatedContextSchema to pageIdSchema (string to number)
- Replace resolvePageByContext() with resolvePageById() in McpContext
- Remove per-context page tracking (#contextSelectedPage map)
- Update all tool files to use pageId routing
- Keep isolatedContext on new_page (browser context isolation, not routing)
- Update tests to use pageId-based assertions
-**uid** (string) **(required)**: The uid of an element on the page from the page content snapshot
73
72
-**value** (string) **(required)**: The value to [`fill`](#fill) in
74
73
-**includeSnapshot** (boolean) _(optional)_: Whether to include a snapshot in the response. Default is false.
74
+
-**pageId** (number) _(optional)_: Targets a specific page by ID.
75
75
76
76
---
77
77
@@ -83,6 +83,7 @@
83
83
84
84
-**elements** (array) **(required)**: Elements from snapshot to [`fill`](#fill) out.
85
85
-**includeSnapshot** (boolean) _(optional)_: Whether to include a snapshot in the response. Default is false.
86
+
-**pageId** (number) _(optional)_: Targets a specific page by ID.
86
87
87
88
---
88
89
@@ -116,17 +117,7 @@
116
117
117
118
-**key** (string) **(required)**: A key or a combination (e.g., "Enter", "Control+A", "Control++", "Control+Shift+R"). Modifiers: Control, Shift, Alt, Meta
118
119
-**includeSnapshot** (boolean) _(optional)_: Whether to include a snapshot in the response. Default is false.
119
-
120
-
---
121
-
122
-
### `type_text`
123
-
124
-
**Description:** Type text using keyboard into a previously focused input
125
-
126
-
**Parameters:**
127
-
128
-
-**text** (string) **(required)**: The text to type
129
-
-**submitKey** (string) _(optional)_: Optional key to press after typing. E.g., "Enter", "Tab", "Escape"
120
+
-**pageId** (number) _(optional)_: Targets a specific page by ID.
130
121
131
122
---
132
123
@@ -139,6 +130,7 @@
139
130
-**filePath** (string) **(required)**: The local path of the file to upload
140
131
-**uid** (string) **(required)**: The uid of the file input element or an element that will open file chooser on the page from the page content snapshot
141
132
-**includeSnapshot** (boolean) _(optional)_: Whether to include a snapshot in the response. Default is false.
133
+
-**pageId** (number) _(optional)_: Targets a specific page by ID.
142
134
143
135
---
144
136
@@ -171,6 +163,7 @@
171
163
-**handleBeforeUnload** (enum: "accept", "decline") _(optional)_: Whether to auto accept or beforeunload dialogs triggered by this navigation. Default is accept.
172
164
-**ignoreCache** (boolean) _(optional)_: Whether to ignore cache on reload.
173
165
-**initScript** (string) _(optional)_: A JavaScript script to be executed on each new document before any other scripts for the next navigation.
166
+
-**pageId** (number) _(optional)_: Targets a specific page by ID.
174
167
-**timeout** (integer) _(optional)_: Maximum wait time in milliseconds. If set to 0, the default timeout will be used.
175
168
-**type** (enum: "url", "back", "forward", "reload") _(optional)_: Navigate the page by URL, back or forward in history, or reload.
-**text** (array) **(required)**: Non-empty list of texts. Resolves when any value appears on the page.
204
+
-**pageId** (number) _(optional)_: Targets a specific page by ID.
211
205
-**timeout** (integer) _(optional)_: Maximum wait time in milliseconds. If set to 0, the default timeout will be used.
212
206
213
207
---
@@ -224,6 +218,7 @@
224
218
-**cpuThrottlingRate** (number) _(optional)_: Represents the CPU slowdown factor. Set the rate to 1 to disable throttling. If omitted, throttling remains unchanged.
225
219
-**geolocation** (unknown) _(optional)_: Geolocation to [`emulate`](#emulate). Set to null to clear the geolocation override.
226
220
-**networkConditions** (enum: "No emulation", "Offline", "Slow 3G", "Fast 3G", "Slow 4G", "Fast 4G") _(optional)_: Throttle network. Set to "No emulation" to disable. If omitted, conditions remain unchanged.
221
+
-**pageId** (number) _(optional)_: Targets a specific page by ID.
227
222
-**userAgent** (unknown) _(optional)_: User agent to [`emulate`](#emulate). Set to null to clear the user agent override.
228
223
-**viewport** (unknown) _(optional)_: Viewport to [`emulate`](#emulate). Set to null to reset to the default viewport.
229
224
@@ -237,6 +232,7 @@
237
232
238
233
-**height** (number) **(required)**: Page height
239
234
-**width** (number) **(required)**: Page width
235
+
-**pageId** (number) _(optional)_: Targets a specific page by ID.
240
236
241
237
---
242
238
@@ -262,6 +258,7 @@
262
258
-**autoStop** (boolean) **(required)**: Determines if the trace recording should be automatically stopped.
263
259
-**reload** (boolean) **(required)**: Determines if, once tracing has started, the current selected page should be automatically reloaded. Navigate the page to the right URL using the [`navigate_page`](#navigate_page) tool BEFORE starting the trace if reload or autoStop is set to true.
264
260
-**filePath** (string) _(optional)_: The absolute file path, or a file path relative to the current working directory, to save the raw trace data. For example, trace.json.gz (compressed) or trace.json (uncompressed).
261
+
-**pageId** (number) _(optional)_: Targets a specific page by ID.
265
262
266
263
---
267
264
@@ -272,6 +269,7 @@
272
269
**Parameters:**
273
270
274
271
-**filePath** (string) _(optional)_: The absolute file path, or a file path relative to the current working directory, to save the raw trace data. For example, trace.json.gz (compressed) or trace.json (uncompressed).
272
+
-**pageId** (number) _(optional)_: Targets a specific page by ID.
275
273
276
274
---
277
275
@@ -332,6 +330,7 @@ so returned values have to be JSON-serializable.
332
330
}`
333
331
334
332
-**args** (array) _(optional)_: An optional list of arguments to pass to the function.
333
+
-**pageId** (number) _(optional)_: Targets a specific page by ID.
335
334
336
335
---
337
336
@@ -367,6 +366,7 @@ so returned values have to be JSON-serializable.
367
366
-**filePath** (string) _(optional)_: The absolute path, or a path relative to the current working directory, to save the screenshot to instead of attaching it to the response.
368
367
-**format** (enum: "png", "jpeg", "webp") _(optional)_: Type of format to save the screenshot as. Default is "png"
369
368
-**fullPage** (boolean) _(optional)_: If set to true takes a screenshot of the full page instead of the currently visible viewport. Incompatible with uid.
369
+
-**pageId** (number) _(optional)_: Targets a specific page by ID.
370
370
-**quality** (number) _(optional)_: Compression quality for JPEG and WebP formats (0-100). Higher values mean better quality but larger file sizes. Ignored for PNG format.
371
371
-**uid** (string) _(optional)_: The uid of an element on the page from the page content snapshot. If omitted takes a pages screenshot.
372
372
@@ -381,6 +381,7 @@ in the DevTools Elements panel (if any).
381
381
**Parameters:**
382
382
383
383
-**filePath** (string) _(optional)_: The absolute path, or a path relative to the current working directory, to save the snapshot to instead of attaching it to the response.
384
+
-**pageId** (number) _(optional)_: Targets a specific page by ID.
384
385
-**verbose** (boolean) _(optional)_: Whether to include all possible information available in the full a11y tree. Default is false.
0 commit comments