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
72
72
-**value** (string) **(required)**: The value to [`fill`](#fill) in
73
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.
74
75
75
76
---
76
77
@@ -82,6 +83,7 @@
82
83
83
84
-**elements** (array) **(required)**: Elements from snapshot to [`fill`](#fill) out.
84
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.
85
87
86
88
---
87
89
@@ -115,6 +117,7 @@
115
117
116
118
-**key** (string) **(required)**: A key or a combination (e.g., "Enter", "Control+A", "Control++", "Control+Shift+R"). Modifiers: Control, Shift, Alt, Meta
117
119
-**includeSnapshot** (boolean) _(optional)_: Whether to include a snapshot in the response. Default is false.
120
+
-**pageId** (number) _(optional)_: Targets a specific page by ID.
118
121
119
122
---
120
123
@@ -127,6 +130,7 @@
127
130
-**filePath** (string) **(required)**: The local path of the file to upload
128
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
129
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.
130
134
131
135
---
132
136
@@ -159,6 +163,7 @@
159
163
-**handleBeforeUnload** (enum: "accept", "decline") _(optional)_: Whether to auto accept or beforeunload dialogs triggered by this navigation. Default is accept.
160
164
-**ignoreCache** (boolean) _(optional)_: Whether to ignore cache on reload.
161
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.
162
167
-**timeout** (integer) _(optional)_: Maximum wait time in milliseconds. If set to 0, the default timeout will be used.
163
168
-**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
204
+
-**pageId** (number) _(optional)_: Targets a specific page by ID.
199
205
-**timeout** (integer) _(optional)_: Maximum wait time in milliseconds. If set to 0, the default timeout will be used.
200
206
201
207
---
@@ -212,6 +218,7 @@
212
218
-**cpuThrottlingRate** (number) _(optional)_: Represents the CPU slowdown factor. Set the rate to 1 to disable throttling. If omitted, throttling remains unchanged.
213
219
-**geolocation** (unknown) _(optional)_: Geolocation to [`emulate`](#emulate). Set to null to clear the geolocation override.
214
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.
215
222
-**userAgent** (unknown) _(optional)_: User agent to [`emulate`](#emulate). Set to null to clear the user agent override.
216
223
-**viewport** (unknown) _(optional)_: Viewport to [`emulate`](#emulate). Set to null to reset to the default viewport.
217
224
@@ -225,6 +232,7 @@
225
232
226
233
-**height** (number) **(required)**: Page height
227
234
-**width** (number) **(required)**: Page width
235
+
-**pageId** (number) _(optional)_: Targets a specific page by ID.
228
236
229
237
---
230
238
@@ -250,6 +258,7 @@
250
258
-**autoStop** (boolean) **(required)**: Determines if the trace recording should be automatically stopped.
251
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.
252
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.
253
262
254
263
---
255
264
@@ -260,6 +269,7 @@
260
269
**Parameters:**
261
270
262
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.
263
273
264
274
---
265
275
@@ -320,6 +330,7 @@ so returned values have to be JSON-serializable.
320
330
}`
321
331
322
332
-**args** (array) _(optional)_: An optional list of arguments to pass to the function.
333
+
-**pageId** (number) _(optional)_: Targets a specific page by ID.
323
334
324
335
---
325
336
@@ -355,6 +366,7 @@ so returned values have to be JSON-serializable.
355
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.
356
367
-**format** (enum: "png", "jpeg", "webp") _(optional)_: Type of format to save the screenshot as. Default is "png"
357
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.
358
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.
359
371
-**uid** (string) _(optional)_: The uid of an element on the page from the page content snapshot. If omitted takes a pages screenshot.
360
372
@@ -369,6 +381,7 @@ in the DevTools Elements panel (if any).
369
381
**Parameters:**
370
382
371
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.
372
385
-**verbose** (boolean) _(optional)_: Whether to include all possible information available in the full a11y tree. Default is false.
0 commit comments