feat(mcp): add network offline state tools#39459
feat(mcp): add network offline state tools#39459MatSFT wants to merge 6 commits intomicrosoft:mainfrom
Conversation
Add two new MCP tools to manage browser network offline state: - browser_network_status: Get current network state (online/offline) - browser_network_set_offline: Set network state to online or offline Also adds isOffline() method to BrowserContext API to query the current offline state from the server. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
|
@microsoft-github-policy-service agree company="Microsoft" |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
Add tests for browser_network_status and browser_network_set_offline MCP tools that were implemented in the previous commit. Also adds CLI commands (network-status, network-set-offline) to expose these tools via the CLI interface. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
Update the network offline test to match error messages from all browsers: - Chrome: net::ERR_INTERNET_DISCONNECTED - Firefox: NS_ERROR_OFFLINE - WebKit: WebKit encountered an internal error Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
- Rename browser_network_status to browser_network_state
- Rename browser_network_set_offline to browser_set_network_state
- Change input from { offline: boolean } to { state: "online" | "offline" }
- Update CLI commands: network-status → network-state, network-set-offline → set-network-state
- Update CLI option from --offline to --state
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
7f318da to
f8b2e66
Compare
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
|
The test failures do not seem relevant to the code changes |
yury-s
left a comment
There was a problem hiding this comment.
Can you start with filing an issue that describes the use case?
|
- Remove browser_network_state read-only tool and network-state CLI command - Rename browser_set_network_state to browser_network_state_set - Rename CLI command set-network-state to network-state-set Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Remove the isOffline() method that was added as part of the network offline tools feature. The MCP implementation doesn't need this public API method. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Test results for "MCP"5 failed 5193 passed, 171 skipped Merge workflow run. |
Test results for "tests 1"1 failed 8 flaky38654 passed, 841 skipped Merge workflow run. |
Summary
network_state: Get current network state (online/offline)set_network_state: Set network state to online or offlineisOffline()method to BrowserContext API to query the current offline stateTest plan
npx playwright test --config=tests/mcp/playwright.config.ts --grep networkset_network_state offline🤖 Generated with Claude Code