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
71
71
-**value** (string) **(required)**: The value to [`fill`](#fill) in
72
72
-**includeSnapshot** (boolean) _(optional)_: Whether to include a snapshot in the response. Default is false.
73
+
-**pageId** (number) _(optional)_: Targets a specific page by ID.
73
74
74
75
---
75
76
@@ -81,6 +82,7 @@
81
82
82
83
-**elements** (array) **(required)**: Elements from snapshot to [`fill`](#fill) out.
83
84
-**includeSnapshot** (boolean) _(optional)_: Whether to include a snapshot in the response. Default is false.
85
+
-**pageId** (number) _(optional)_: Targets a specific page by ID.
84
86
85
87
---
86
88
@@ -114,6 +116,7 @@
114
116
115
117
-**key** (string) **(required)**: A key or a combination (e.g., "Enter", "Control+A", "Control++", "Control+Shift+R"). Modifiers: Control, Shift, Alt, Meta
116
118
-**includeSnapshot** (boolean) _(optional)_: Whether to include a snapshot in the response. Default is false.
119
+
-**pageId** (number) _(optional)_: Targets a specific page by ID.
117
120
118
121
---
119
122
@@ -126,6 +129,7 @@
126
129
-**filePath** (string) **(required)**: The local path of the file to upload
127
130
-**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
128
131
-**includeSnapshot** (boolean) _(optional)_: Whether to include a snapshot in the response. Default is false.
132
+
-**pageId** (number) _(optional)_: Targets a specific page by ID.
129
133
130
134
---
131
135
@@ -158,6 +162,7 @@
158
162
-**handleBeforeUnload** (enum: "accept", "decline") _(optional)_: Whether to auto accept or beforeunload dialogs triggered by this navigation. Default is accept.
159
163
-**ignoreCache** (boolean) _(optional)_: Whether to ignore cache on reload.
160
164
-**initScript** (string) _(optional)_: A JavaScript script to be executed on each new document before any other scripts for the next navigation.
165
+
-**pageId** (number) _(optional)_: Targets a specific page by ID.
161
166
-**timeout** (integer) _(optional)_: Maximum wait time in milliseconds. If set to 0, the default timeout will be used.
162
167
-**type** (enum: "url", "back", "forward", "reload") _(optional)_: Navigate the page by URL, back or forward in history, or reload.
-**text** (string) **(required)**: Text to appear on the page
203
+
-**pageId** (number) _(optional)_: Targets a specific page by ID.
198
204
-**timeout** (integer) _(optional)_: Maximum wait time in milliseconds. If set to 0, the default timeout will be used.
199
205
200
206
---
@@ -211,6 +217,7 @@
211
217
-**cpuThrottlingRate** (number) _(optional)_: Represents the CPU slowdown factor. Set the rate to 1 to disable throttling. If omitted, throttling remains unchanged.
212
218
-**geolocation** (unknown) _(optional)_: Geolocation to [`emulate`](#emulate). Set to null to clear the geolocation override.
213
219
-**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.
220
+
-**pageId** (number) _(optional)_: Targets a specific page by ID.
214
221
-**userAgent** (unknown) _(optional)_: User agent to [`emulate`](#emulate). Set to null to clear the user agent override.
215
222
-**viewport** (unknown) _(optional)_: Viewport to [`emulate`](#emulate). Set to null to reset to the default viewport.
216
223
@@ -224,6 +231,7 @@
224
231
225
232
-**height** (number) **(required)**: Page height
226
233
-**width** (number) **(required)**: Page width
234
+
-**pageId** (number) _(optional)_: Targets a specific page by ID.
227
235
228
236
---
229
237
@@ -249,6 +257,7 @@
249
257
-**autoStop** (boolean) **(required)**: Determines if the trace recording should be automatically stopped.
250
258
-**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.
251
259
-**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).
260
+
-**pageId** (number) _(optional)_: Targets a specific page by ID.
252
261
253
262
---
254
263
@@ -259,6 +268,7 @@
259
268
**Parameters:**
260
269
261
270
-**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).
271
+
-**pageId** (number) _(optional)_: Targets a specific page by ID.
262
272
263
273
---
264
274
@@ -309,6 +319,7 @@ so returned values have to be JSON-serializable.
309
319
}`
310
320
311
321
-**args** (array) _(optional)_: An optional list of arguments to pass to the function.
322
+
-**pageId** (number) _(optional)_: Targets a specific page by ID.
312
323
313
324
---
314
325
@@ -344,6 +355,7 @@ so returned values have to be JSON-serializable.
344
355
-**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.
345
356
-**format** (enum: "png", "jpeg", "webp") _(optional)_: Type of format to save the screenshot as. Default is "png"
346
357
-**fullPage** (boolean) _(optional)_: If set to true takes a screenshot of the full page instead of the currently visible viewport. Incompatible with uid.
358
+
-**pageId** (number) _(optional)_: Targets a specific page by ID.
347
359
-**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.
348
360
-**uid** (string) _(optional)_: The uid of an element on the page from the page content snapshot. If omitted takes a pages screenshot.
349
361
@@ -358,6 +370,7 @@ in the DevTools Elements panel (if any).
358
370
**Parameters:**
359
371
360
372
-**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.
373
+
-**pageId** (number) _(optional)_: Targets a specific page by ID.
361
374
-**verbose** (boolean) _(optional)_: Whether to include all possible information available in the full a11y tree. Default is false.
0 commit comments