mirror of
https://github.com/ChromeDevTools/chrome-devtools-mcp.git
synced 2026-09-14 19:45:30 +08:00
feat: Add cookie-debugging skill and improve network/pages tool descriptions (#2596)
#408
This commit is contained in:
@@ -374,6 +374,7 @@ grok mcp add chrome-devtools npx chrome-devtools-mcp@latest
|
||||
```
|
||||
|
||||
See the <a href="https://docs.x.ai/build/features/skills-plugins-marketplaces">docs</a> for more options
|
||||
|
||||
</details>
|
||||
|
||||
<details>
|
||||
|
||||
@@ -243,7 +243,7 @@
|
||||
|
||||
- **url** (string) **(required)**: URL to load in a new page.
|
||||
- **background** (boolean) _(optional)_: Whether to open the page in the background without bringing it to the front. Default is false (foreground).
|
||||
- **isolatedContext** (string) _(optional)_: If specified, the page is created in an isolated browser context with the given name. Pages in the same browser context share cookies and storage. Pages in different browser contexts are fully isolated.
|
||||
- **isolatedContext** (string) _(optional)_: If specified, the page is created in an isolated browser context with the given name. Pages in the same browser context share cookies and storage. Pages in different browser contexts are fully isolated (useful for clean-slate testing of cookies and authentication).
|
||||
- **timeout** (integer) _(optional)_: Maximum wait time in milliseconds. If set to 0, the default timeout will be used.
|
||||
|
||||
---
|
||||
@@ -344,7 +344,7 @@
|
||||
|
||||
### `get_network_request`
|
||||
|
||||
**Description:** Gets a network request by an optional reqid, if omitted returns the currently selected request in the DevTools Network panel.
|
||||
**Description:** Gets a network request by an optional reqid, if omitted returns the currently selected request in the DevTools Network panel. Useful for inspecting request headers (including 'Cookie') and response headers (including 'Set-Cookie' and directives).
|
||||
|
||||
**Parameters:**
|
||||
|
||||
|
||||
+15
-7
@@ -19,8 +19,8 @@ const ROOT_DIR = path.resolve(import.meta.dirname, '..');
|
||||
const SCENARIOS_DIR = path.join(import.meta.dirname, 'eval_scenarios');
|
||||
const SKILL_PATH = path.join(ROOT_DIR, 'skills', 'chrome-devtools', 'SKILL.md');
|
||||
|
||||
import type {CapturedFunctionCall, TestScenario} from './eval_result.ts';
|
||||
import {Result} from './eval_result.ts';
|
||||
import type {CapturedFunctionCall, TestScenario} from './eval_result.js';
|
||||
import {Result} from './eval_result.js';
|
||||
export type {CapturedFunctionCall, TestScenario};
|
||||
export {Result};
|
||||
|
||||
@@ -41,6 +41,7 @@ async function runSingleScenario(
|
||||
modelId: string,
|
||||
debug: boolean,
|
||||
includeSkill: boolean,
|
||||
skillPath: string = SKILL_PATH,
|
||||
extraServerArgs: string[] = [],
|
||||
): Promise<void> {
|
||||
const debugLog = (...args: unknown[]) => {
|
||||
@@ -62,12 +63,12 @@ async function runSingleScenario(
|
||||
|
||||
// Prepend skill content if requested
|
||||
if (includeSkill) {
|
||||
if (!fs.existsSync(SKILL_PATH)) {
|
||||
if (!fs.existsSync(skillPath)) {
|
||||
throw new Error(
|
||||
`Skill file not found at ${SKILL_PATH}. Please ensure the skill file exists.`,
|
||||
`Skill file not found at ${skillPath}. Please ensure the skill file exists.`,
|
||||
);
|
||||
}
|
||||
const skillContent = fs.readFileSync(SKILL_PATH, 'utf-8');
|
||||
const skillContent = fs.readFileSync(skillPath, 'utf-8');
|
||||
scenario.prompt = `${skillContent}\n\n---\n\n${scenario.prompt}`;
|
||||
}
|
||||
|
||||
@@ -106,7 +107,7 @@ async function runSingleScenario(
|
||||
});
|
||||
env['CHROME_DEVTOOLS_MCP_NO_USAGE_STATISTICS'] = 'true';
|
||||
|
||||
const args = [serverPath];
|
||||
const args = [serverPath, '--isolated'];
|
||||
if (!debug) {
|
||||
args.push('--headless');
|
||||
}
|
||||
@@ -200,6 +201,9 @@ async function main() {
|
||||
type: 'boolean',
|
||||
default: false,
|
||||
},
|
||||
'skill-path': {
|
||||
type: 'string',
|
||||
},
|
||||
'server-args': {
|
||||
type: 'string',
|
||||
},
|
||||
@@ -210,7 +214,10 @@ async function main() {
|
||||
const modelId = values.model;
|
||||
const debug = values.debug;
|
||||
const repeat = values.repeat;
|
||||
const includeSkill = values['include-skill'];
|
||||
const includeSkill = values['include-skill'] || Boolean(values['skill-path']);
|
||||
const skillPath = values['skill-path']
|
||||
? path.resolve(ROOT_DIR, values['skill-path'])
|
||||
: SKILL_PATH;
|
||||
const extraServerArgs = values['server-args']
|
||||
? values['server-args'].split(/\s+/)
|
||||
: [];
|
||||
@@ -245,6 +252,7 @@ async function main() {
|
||||
modelId,
|
||||
debug,
|
||||
includeSkill,
|
||||
skillPath,
|
||||
extraServerArgs,
|
||||
);
|
||||
console.log(`✔ ${path.relative(ROOT_DIR, scenarioPath)} (Run ${i})`);
|
||||
|
||||
@@ -31,7 +31,7 @@ export class Result {
|
||||
|
||||
/**
|
||||
* Consumes initial page navigation/setup boilerplate.
|
||||
* - Ignores/skips leading list_pages calls.
|
||||
* - Ignores/skips leading or trailing list_pages calls.
|
||||
* - Asserts that new_page or navigate_page was called.
|
||||
* - Determines the expected pageId.
|
||||
* - Returns the active pageId.
|
||||
@@ -49,6 +49,10 @@ export class Result {
|
||||
);
|
||||
this.nextCallIndex++;
|
||||
|
||||
if (this.calls[this.nextCallIndex]?.name === 'list_pages') {
|
||||
this.nextCallIndex++;
|
||||
}
|
||||
|
||||
const isNewPage = navCall.name === 'new_page';
|
||||
let pageId: number | undefined;
|
||||
if (this.hasPageIdRouting) {
|
||||
|
||||
@@ -0,0 +1,52 @@
|
||||
/**
|
||||
* @license
|
||||
* Copyright 2026 Google LLC
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
import assert from 'node:assert';
|
||||
|
||||
import type {TestScenario} from '../eval_gemini.js';
|
||||
|
||||
export const scenario: TestScenario = {
|
||||
prompt:
|
||||
'Open <TEST_URL> in an isolated browser context called banner-test to check the cookie consent banner, take a snapshot, and click Decline.',
|
||||
maxTurns: 5,
|
||||
htmlRoute: {
|
||||
path: '/cookie_banner_test.html',
|
||||
htmlContent: `
|
||||
<h1>Cookie Consent Test</h1>
|
||||
<div id="cookie-banner">
|
||||
<p>We use cookies to improve your experience.</p>
|
||||
<button id="accept-btn">Accept All</button>
|
||||
<button id="decline-btn">Decline</button>
|
||||
</div>
|
||||
`,
|
||||
},
|
||||
expectations: result => {
|
||||
const newPageCall = result.calls.find(c => c.name === 'new_page');
|
||||
assert.ok(
|
||||
newPageCall,
|
||||
'Expected new_page to be called for isolated context testing',
|
||||
);
|
||||
assert.strictEqual(
|
||||
newPageCall.args.isolatedContext,
|
||||
'banner-test',
|
||||
"Expected isolatedContext to be 'banner-test'",
|
||||
);
|
||||
|
||||
const pageId = result.consumePageNavigation();
|
||||
assert.ok(result.remainingCalls.length >= 2);
|
||||
const snapshotCall = result.calls.find(c => c.name === 'take_snapshot');
|
||||
assert.ok(snapshotCall, 'Expected take_snapshot to be called');
|
||||
const clickCall = result.calls.find(c => c.name === 'click');
|
||||
assert.ok(clickCall, 'Expected click to be called');
|
||||
assert.ok(
|
||||
clickCall.args.uid,
|
||||
'Expected click to specify a valid element uid',
|
||||
);
|
||||
if (result.hasPageIdRouting && pageId !== undefined) {
|
||||
assert.strictEqual(clickCall.args.pageId, pageId);
|
||||
}
|
||||
},
|
||||
};
|
||||
@@ -0,0 +1,41 @@
|
||||
/**
|
||||
* @license
|
||||
* Copyright 2026 Google LLC
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
import assert from 'node:assert';
|
||||
|
||||
import type {TestScenario} from '../eval_gemini.js';
|
||||
|
||||
export const scenario: TestScenario = {
|
||||
prompt:
|
||||
'Navigate to <TEST_URL> and inspect the network request headers to diagnose the authentication failure.',
|
||||
maxTurns: 6,
|
||||
htmlRoute: {
|
||||
path: '/cookie_auth_test.html',
|
||||
htmlContent: `
|
||||
<h1>Authentication Test</h1>
|
||||
<script>
|
||||
fetch('/api/user', {
|
||||
headers: { 'Accept': 'application/json' },
|
||||
credentials: 'include'
|
||||
});
|
||||
</script>
|
||||
`,
|
||||
},
|
||||
expectations: result => {
|
||||
result.consumePageNavigation();
|
||||
const listRequestsCall = result.calls.find(
|
||||
c => c.name === 'list_network_requests',
|
||||
);
|
||||
assert.ok(listRequestsCall, 'Expected list_network_requests to be called');
|
||||
const getRequestCall = result.calls.find(
|
||||
c => c.name === 'get_network_request',
|
||||
);
|
||||
assert.ok(
|
||||
getRequestCall,
|
||||
'Expected get_network_request to be called to inspect headers',
|
||||
);
|
||||
},
|
||||
};
|
||||
@@ -0,0 +1,31 @@
|
||||
/**
|
||||
* @license
|
||||
* Copyright 2026 Google LLC
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
import assert from 'node:assert';
|
||||
|
||||
import type {TestScenario} from '../eval_gemini.js';
|
||||
|
||||
export const scenario: TestScenario = {
|
||||
prompt:
|
||||
'Reload the page <TEST_URL> and inspect the network request headers to view the active HttpOnly cookie.',
|
||||
maxTurns: 4,
|
||||
htmlRoute: {
|
||||
path: '/cookie_httponly_test.html',
|
||||
htmlContent: `
|
||||
<h1>HttpOnly Session Test</h1>
|
||||
`,
|
||||
},
|
||||
expectations: result => {
|
||||
result.consumePageNavigation();
|
||||
const getRequestCall = result.calls.find(
|
||||
c => c.name === 'get_network_request',
|
||||
);
|
||||
assert.ok(
|
||||
getRequestCall,
|
||||
'Expected get_network_request to be called to inspect HttpOnly headers',
|
||||
);
|
||||
},
|
||||
};
|
||||
@@ -0,0 +1,30 @@
|
||||
/**
|
||||
* @license
|
||||
* Copyright 2026 Google LLC
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
import assert from 'node:assert';
|
||||
|
||||
import type {TestScenario} from '../eval_gemini.ts';
|
||||
|
||||
export const scenario: TestScenario = {
|
||||
prompt:
|
||||
'Navigate to <TEST_URL> and inspect the console issues to check for cookie security or SameSite policy warnings.',
|
||||
maxTurns: 3,
|
||||
htmlRoute: {
|
||||
path: '/cookie_issues_test.html',
|
||||
htmlContent: `
|
||||
<h1>Cookie Issues Test</h1>
|
||||
<p>Testing SameSite and CHIPS issues</p>
|
||||
`,
|
||||
},
|
||||
expectations: result => {
|
||||
const pageId = result.consumePageNavigation();
|
||||
assert.ok(result.remainingCalls.length >= 1);
|
||||
result.assertNextCall('list_console_messages', {
|
||||
types: ['issue'],
|
||||
...(result.hasPageIdRouting ? {pageId} : {}),
|
||||
});
|
||||
},
|
||||
};
|
||||
@@ -164,10 +164,22 @@ function updateReadmeWithToolsTOC(toolsTOC: string): void {
|
||||
console.log('Updated README.md with tools table of contents');
|
||||
}
|
||||
|
||||
interface OptionConfig {
|
||||
hidden?: boolean;
|
||||
alias?: string;
|
||||
description?: string;
|
||||
describe?: string;
|
||||
type?: string;
|
||||
choices?: string[];
|
||||
default?: unknown;
|
||||
}
|
||||
|
||||
function generateConfigOptionsMarkdown(): string {
|
||||
let markdown = '';
|
||||
|
||||
for (const [optionName, optionConfig] of Object.entries(mcpOptions)) {
|
||||
for (const [optionName, optionConfig] of Object.entries(
|
||||
mcpOptions as Record<string, OptionConfig>,
|
||||
)) {
|
||||
// Skip hidden options
|
||||
if (optionConfig.hidden) {
|
||||
continue;
|
||||
|
||||
@@ -0,0 +1,149 @@
|
||||
---
|
||||
name: cookie-debugging
|
||||
description: Uses Chrome DevTools MCP for inspecting, debugging, and testing cookies, session state, authentication issues, and cookie consent compliance. Use when diagnosing 401/403 errors, authentication redirects, session expiration, Cookie/Set-Cookie header issues, cookie banner consent conformance, or third-party cookie/SameSite/Partitioned cookie warnings.
|
||||
---
|
||||
|
||||
## Core Concepts
|
||||
|
||||
### HttpOnly vs Client-Side Storage
|
||||
|
||||
Cookies marked `HttpOnly` cannot be accessed or modified by client-side JavaScript (`cookieStore` or `document.cookie`). However, the browser **automatically attaches active HttpOnly cookies to outgoing HTTP request headers (`Cookie`)**.
|
||||
|
||||
- To inspect current `HttpOnly` values: Look at the `Cookie` request header of any outgoing HTTP request via `get_network_request`.
|
||||
- To inspect how cookies were created or configured: Look at the `Set-Cookie` response header of login/auth responses.
|
||||
- To inspect non-`HttpOnly` cookies: Use `evaluate_script` with the modern `cookieStore` API (`async () => await cookieStore.getAll()`).
|
||||
|
||||
### Session Strategy: Live Tab vs Isolated Context
|
||||
|
||||
Choose the right session environment to avoid state contamination (e.g., residual analytics or auth tokens):
|
||||
|
||||
| Strategy | When to Use | Setup / Teardown |
|
||||
| :---------------------------------- | :---------------------------------------------------------------------------- | :------------------------------------------------------------------------------------------------------------ |
|
||||
| **Live Tab (Active Page)** | Diagnosing an active user session, live 401/403 error, or current state. | Operates directly on the currently selected page. |
|
||||
| **Clean-Slate (`isolatedContext`)** | Testing cookie consent banners, first-time visits, or zero-cookie guarantees. | Call `new_page` with a unique `isolatedContext` (e.g. `"consent-audit-1"`). When finished, call `close_page`. |
|
||||
|
||||
### Client-Side Capabilities & Limitations
|
||||
|
||||
| Action | Client JavaScript (`cookieStore` / `document.cookie`) | DevTools Network & Context Tools |
|
||||
| :--------------------------------------------------------------- | :---------------------------------------------------- | :------------------------------------------------------ |
|
||||
| **Read Non-HttpOnly** | ✅ `async () => await cookieStore.getAll()` | ✅ `get_network_request` (Request `Cookie`) |
|
||||
| **Read HttpOnly** | ❌ Blocked by browser security | ✅ `get_network_request` (Request `Cookie`) |
|
||||
| **Inspect Attributes** (`Domain`, `Path`, `SameSite`, `Expires`) | ✅ `async () => await cookieStore.getAll()` | ✅ `get_network_request` (Response `Set-Cookie`) |
|
||||
| **Modify / Delete Non-HttpOnly** | ✅ `async () => await cookieStore.set(...)` | N/A |
|
||||
| **Modify / Delete HttpOnly** | ❌ **Silent failure** in JavaScript | ✅ Use `new_page(isolatedContext: ...)` for clean state |
|
||||
|
||||
> [!WARNING]
|
||||
> Attempting to clear an `HttpOnly` cookie via JavaScript (`cookieStore.delete` or `document.cookie = "...; max-age=0"`) will silently fail. To test in an unauthenticated or fresh state, always spawn a new isolated context using `new_page` with `isolatedContext`.
|
||||
|
||||
---
|
||||
|
||||
## Workflow Patterns
|
||||
|
||||
### 1. Diagnosing Authentication Failures & Redirects (401 / 403)
|
||||
|
||||
When an authenticated page request fails, returns 401/403, or redirects to login:
|
||||
|
||||
1. **List Recent Requests**: Call `list_network_requests` with `includePreservedRequests: true`.
|
||||
2. **Find the Target Request**: Locate the failing request (401/403) or redirect (302/307).
|
||||
3. **Inspect Outgoing `Cookie` Header**: Call `get_network_request` with the `reqid`.
|
||||
- Verify if the `Cookie` header was attached and whether required tokens (e.g. `SESSION_ID`, `auth_token`) were sent.
|
||||
4. **Trigger Active Inspection (If no recent request exists)**:
|
||||
- If the cookie was set in a previous session and no network call is listed, trigger a request:
|
||||
- Use `navigate_page` with `reload: true`, OR
|
||||
- Call `evaluate_script` with `() => fetch(window.location.href)`
|
||||
- Then call `get_network_request` on the new request to inspect the active `Cookie` header.
|
||||
5. **Trace the Setting Request**: If the cookie is missing or rejected:
|
||||
- Check earlier login/handshake responses for `Set-Cookie` directives:
|
||||
- **Path mismatch**: e.g., `Path=/api` when the request is to `/`.
|
||||
- **Domain mismatch**: e.g., `Domain=api.example.com` preventing cookies on `sub.example.com`.
|
||||
- **Secure flag on HTTP**: `Secure` cookies are never sent over unencrypted `http://`.
|
||||
- **SameSite blocking**: `SameSite=Strict` cookies are omitted on cross-site navigations.
|
||||
- **Expiration**: Check if `Expires` or `Max-Age` elapsed.
|
||||
|
||||
### 2. Cookie Banner & Consent Conformance Testing
|
||||
|
||||
To verify that no non-essential or tracking cookies are set before consent or when declining:
|
||||
|
||||
1. **Start Clean**: Open a fresh isolated context with a dedicated name:
|
||||
```json
|
||||
{"url": "<PAGE_URL>", "isolatedContext": "consent-test-1"}
|
||||
```
|
||||
2. **Record Baseline Cookies**: Before interacting with the banner, run `evaluate_script` with `async () => await cookieStore.getAll()`.
|
||||
3. **Inspect Premature Network Requests & Issues**:
|
||||
- Call `list_network_requests` to ensure no third-party tracking beacons fired before consent.
|
||||
- Call `list_console_messages` with `types: ["issue"]` to check for tracking warnings.
|
||||
4. **Interact with Consent Banner**:
|
||||
- Capture snapshot with `take_snapshot` to locate the "Decline" or "Reject All" button `uid`.
|
||||
- Click the button with `click`.
|
||||
5. **Verify Cookie Difference**:
|
||||
- Run `evaluate_script` with `async () => await cookieStore.getAll()` after clicking to assert that only strictly necessary or consent-state cookies exist.
|
||||
6. **Test Consent Revocation (Lifecycle Audit)**:
|
||||
- When auditing consent withdrawal or preference changes:
|
||||
- Locate and click the "Cookie Settings", "Manage Preferences", or footer privacy trigger (`take_snapshot` $\rightarrow$ `click`).
|
||||
- Deselect non-essential categories or click "Revoke All" / "Save Preferences".
|
||||
- Re-query `cookieStore.getAll()` to verify previously accepted non-essential cookies were cleared or expired.
|
||||
- Call `list_network_requests` on subsequent actions to ensure tracking beacons are no longer fired.
|
||||
7. **Teardown Context**: Call `close_page` when the audit is complete to prevent leftover cookies from affecting subsequent tasks.
|
||||
|
||||
### 3. Auditing Cookie Security, SameSite & CHIPS (Partitioned Cookies)
|
||||
|
||||
1. **Fast-Track: Native DevTools Issues (Recommended)**:
|
||||
- Call `list_console_messages` with:
|
||||
```json
|
||||
{
|
||||
"types": ["issue"],
|
||||
"includePreservedMessages": true
|
||||
}
|
||||
```
|
||||
- Check for `CookieIssue` entries, such as:
|
||||
- `SameSiteNoneInsecure`: `SameSite=None` without `Secure`.
|
||||
- `ThirdPartyCookiePhaseout`: Third-party cookie blocked or restricted.
|
||||
- `SchemefulSameSite`: Cross-scheme cookie issues.
|
||||
- `PartitionedCookies`: Invalid CHIPS partitioning attributes.
|
||||
2. **Deep Audit: Lighthouse Third-Party Cookies**:
|
||||
- Run `lighthouse_audit` with `mode: "navigation"` and `outputDirPath: "/tmp/lh-report"`.
|
||||
- **Extract the specific cookie audit** without loading the full report into context:
|
||||
```bash
|
||||
node -e "const r=require('/tmp/lh-report/report.json'); const a=r.audits['third-party-cookies']; console.log(JSON.stringify({score: a?.score, displayValue: a?.displayValue, items: a?.details?.items}))"
|
||||
```
|
||||
|
||||
### 4. Client-Side Cookie Inspection & Manipulation
|
||||
|
||||
For client-accessible, non-`HttpOnly` cookies (e.g., UI preferences, non-sensitive feature flags):
|
||||
|
||||
1. **Read Cookies & Attributes**:
|
||||
- Use the modern asynchronous Cookie Store API:
|
||||
```js
|
||||
async () => await cookieStore.getAll();
|
||||
```
|
||||
- _Fallback for insecure HTTP origins_: `() => document.cookie`.
|
||||
2. **Set / Modify Cookie**:
|
||||
- Set client cookie via `cookieStore`:
|
||||
```js
|
||||
async () =>
|
||||
await cookieStore.set({
|
||||
name: 'theme',
|
||||
value: 'dark',
|
||||
expires: Date.now() + 86400000,
|
||||
sameSite: 'lax',
|
||||
});
|
||||
```
|
||||
3. **Delete Cookie**:
|
||||
- Clear client cookie:
|
||||
```js
|
||||
async () => await cookieStore.delete('theme');
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## Troubleshooting
|
||||
|
||||
- **`cookieStore` is undefined**: `cookieStore` requires a Secure Context (`https://`, `localhost`, or `127.0.0.1`). On non-secure HTTP origins, use `() => document.cookie` or test over HTTPS.
|
||||
- **`evaluate_script` returns empty / unresolved Promise**: `cookieStore` methods are asynchronous. Always wrap calls with `async () => await cookieStore.getAll()`.
|
||||
- **Cookie not visible in JavaScript**: The cookie is marked `HttpOnly`. Trigger a network request and call `get_network_request` to view it in the `Cookie` request header.
|
||||
- **JavaScript deletion did not remove cookie**: The cookie is `HttpOnly` or requires matching `Path` and `Domain` parameters. Use a fresh `isolatedContext` with `new_page` for a clean slate.
|
||||
- **Cookie set in response but not sent in requests**:
|
||||
- Verify if page is `http://` while cookie specifies `Secure`.
|
||||
- Check if `Domain` restricts subdomains.
|
||||
- Check `list_console_messages(types: ["issue"])` for browser rejection reasons.
|
||||
- **Residual cookies contaminating audits**: Always use `new_page` with a unique `isolatedContext` when running compliance tests, and call `close_page` when done.
|
||||
@@ -703,7 +703,7 @@ export const commands: Commands = {
|
||||
},
|
||||
get_network_request: {
|
||||
description:
|
||||
'Gets a network request by an optional reqid, if omitted returns the currently selected request in the DevTools Network panel.',
|
||||
"Gets a network request by an optional reqid, if omitted returns the currently selected request in the DevTools Network panel. Useful for inspecting request headers (including 'Cookie') and response headers (including 'Set-Cookie' and directives).",
|
||||
category: 'Network',
|
||||
args: {
|
||||
pageId: {
|
||||
@@ -1114,7 +1114,7 @@ export const commands: Commands = {
|
||||
name: 'isolatedContext',
|
||||
type: 'string',
|
||||
description:
|
||||
'If specified, the page is created in an isolated browser context with the given name. Pages in the same browser context share cookies and storage. Pages in different browser contexts are fully isolated.',
|
||||
'If specified, the page is created in an isolated browser context with the given name. Pages in the same browser context share cookies and storage. Pages in different browser contexts are fully isolated (useful for clean-slate testing of cookies and authentication).',
|
||||
required: false,
|
||||
},
|
||||
timeout: {
|
||||
|
||||
@@ -90,7 +90,7 @@ export const listNetworkRequests = definePageTool({
|
||||
|
||||
export const getNetworkRequest = definePageTool({
|
||||
name: 'get_network_request',
|
||||
description: `Gets a network request by an optional reqid, if omitted returns the currently selected request in the DevTools Network panel.`,
|
||||
description: `Gets a network request by an optional reqid, if omitted returns the currently selected request in the DevTools Network panel. Useful for inspecting request headers (including 'Cookie') and response headers (including 'Set-Cookie' and directives).`,
|
||||
annotations: {
|
||||
category: ToolCategory.NETWORK,
|
||||
readOnlyHint: false,
|
||||
|
||||
+1
-1
@@ -118,7 +118,7 @@ export const newPage = defineTool(() => {
|
||||
.describe(
|
||||
'If specified, the page is created in an isolated browser context with the given name. ' +
|
||||
'Pages in the same browser context share cookies and storage. ' +
|
||||
'Pages in different browser contexts are fully isolated.',
|
||||
'Pages in different browser contexts are fully isolated (useful for clean-slate testing of cookies and authentication).',
|
||||
),
|
||||
...timeoutSchema,
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user