-
Notifications
You must be signed in to change notification settings - Fork 3.5k
feat: Add cookie-debugging skill and improve network/pages tool descriptions #2596
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
natorion
wants to merge
16
commits into
ChromeDevTools:main
Choose a base branch
from
natorion:cookie-debugging
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
16 commits
Select commit
Hold shift + click to select a range
b94bd12
feat: Add cookie-debugging skill and improve network/pages tool descr…
natorion 6724c95
docs(skills): address agent feedback on cookie-debugging workflows an…
natorion 5574e21
test: add eval scenarios for active HttpOnly triggers and cookie secu…
natorion 0326940
test: handle optional list_pages and select_page in eval scenarios
natorion cf9aea7
test: consume all initial setup/navigation boilerplate in eval runner
natorion 9119ac3
test: refine cookie eval scenario assertions and add --isolated to ev…
natorion 249d12c
refactor(eval): retain original SKILL_PATH constant name
natorion f940b03
fix(eval): use SKILL_PATH as default parameter value in runSingleScen…
natorion c533b36
chore: run npm run gen to update generated CLI options and docs
natorion 89aafa4
refactor(eval): streamline consumePageNavigation and update JSDoc
natorion 177d723
refactor(skills): remove cookie-snippets.md and streamline cookie-deb…
natorion eca4598
style: apply npm run format
natorion 950a0af
docs(skills): lead with cookieStore API and add secure context and as…
natorion 921e56c
style: revert pipe formatting in McpPage, ToolDefinition, WaitForHelp…
natorion 0af7760
docs(skills): add consent revocation lifecycle audit step to cookie-d…
natorion 8b5e182
style: apply npm run format
natorion File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -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); | ||
| } | ||
| }, | ||
| }; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -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', | ||
| ); | ||
| }, | ||
| }; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -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', | ||
| ); | ||
| }, | ||
| }; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -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} : {}), | ||
| }); | ||
| }, | ||
| }; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.