Skip to content

feat(api): open api needed for mcp - #39646

Merged
Pavel Feldman (pavelfeldman) merged 1 commit into
microsoft:mainfrom
pavelfeldman:mcp_apis
Mar 12, 2026
Merged

Pavel Feldman (pavelfeldman) merged 1 commit into
microsoft:mainfrom
pavelfeldman:mcp_apis

Conversation

@pavelfeldman

Copy link
Copy Markdown
Member

No description provided.

@github-actions

This comment has been minimized.

The [origin] to grant permissions to, e.g. "https://example.com".

## method: BrowserContext.isClosedOrClosing
* since: v1.59

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

js-only ?

### option: Locator.locator.hasNotText = %%-locator-option-has-not-text-%%
* since: v1.33

## async method: Locator.normalize

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't understand where it may be needed apart from formatting and if it's formatting-specific then should be part of that api.

`- Page Snapshot:`,
'```yaml',
(await (page as Page)._snapshotForAI()).full,
(await (page as Page).snapshotForAI()).full,

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
(await (page as Page).snapshotForAI()).full,
(await page.snapshotForAI()).full,

const locator = this.page.locator(param.selector);
try {
await locator._resolveSelector();
await locator.normalize();

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Documentation doesn't say anything about when the method can throw.

@github-actions

Copy link
Copy Markdown
Contributor

Test results for "MCP"

1 failed
❌ [chrome] › mcp/http.spec.ts:207 › http transport browser lifecycle (persistent) @mcp-macos-latest

5255 passed, 165 skipped


Merge workflow run.

@github-actions

Copy link
Copy Markdown
Contributor

Test results for "tests 1"

1 failed
❌ [playwright-test] › ui-mode-test-network-tab.spec.ts:397 › should not preserve selection across test runs @macos-latest-node20

3 flaky ⚠️ [chromium-library] › library/trace-viewer.spec.ts:1230 › should display language-specific locators `@chromium-ubuntu-22.04-node24`
⚠️ [firefox-library] › library/inspector/cli-codegen-1.spec.ts:1080 › cli codegen › should not throw csp directive violation errors `@firefox-ubuntu-22.04-node20`
⚠️ [firefox-library] › library/trace-viewer.spec.ts:1230 › should display language-specific locators `@firefox-ubuntu-22.04-node20`

38698 passed, 846 skipped


Merge workflow run.

zubair-farahi121 pushed a commit to zubair-farahi121/mcp-accessibility-scanner that referenced this pull request Sep 16, 2026
…n removal)

playwright-core 1.59 removed the private `_evaluateFunction` helper
(microsoft/playwright#39646), which this repo's pinned 1.60 no longer
exposes. As a result `browser_evaluate` threw
`receiver._evaluateFunction is not a function` on every call.

Port Playwright's own fix: hand the public `evaluate()` an empty function
whose `toString()` returns the user-supplied source, so it serializes and
runs that source without the private method, `eval`, or an `as any` cast.

Add a unit test that guards against calling `_evaluateFunction` and covers
both page- and element-scoped evaluation, plus an e2e smoke assertion.
Document `browser_evaluate` in the README tool list.

Fixes #84

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DqMQPGGdv4cDPTtRuENqxj
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants