Skip to content

Commit c016643

Browse files
authored
chore: mark v0.0.47 (#1198)
1 parent 8cc557d commit c016643

File tree

7 files changed

+66
-33
lines changed

7 files changed

+66
-33
lines changed

README.md

Lines changed: 40 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -270,15 +270,6 @@ Playwright MCP server supports following arguments. They can be provided in the
270270
server is allowed to serve from.
271271
Defaults to the host the server is bound
272272
to. Pass '*' to disable the host check.
273-
--allowed-origins <origins> semicolon-separated list of origins to
274-
allow the browser to request. Default is
275-
to allow all.
276-
--blocked-origins <origins> semicolon-separated list of origins to
277-
block the browser from requesting.
278-
Blocklist is evaluated before allowlist.
279-
If used without the allowlist, requests
280-
not matching the blocklist are still
281-
allowed.
282273
--block-service-workers block service workers
283274
--browser <browser> browser or chrome channel to use,
284275
possible values: chrome, firefox,
@@ -307,6 +298,8 @@ Playwright MCP server supports following arguments. They can be provided in the
307298
localhost. Use 0.0.0.0 to bind to all
308299
interfaces.
309300
--ignore-https-errors ignore https errors
301+
--init-page <path...> path to TypeScript file to evaluate on
302+
Playwright page object
310303
--init-script <path...> path to JavaScript file to add as an
311304
initialization script. The script will
312305
be evaluated in every page before any of
@@ -402,6 +395,35 @@ state [here](https://playwright.dev/docs/auth).
402395

403396
The Playwright MCP Chrome Extension allows you to connect to existing browser tabs and leverage your logged-in sessions and browser state. See [extension/README.md](extension/README.md) for installation and setup instructions.
404397

398+
### Initial state
399+
400+
There are multiple ways to provide the initial state to the browser context or a page.
401+
402+
For the storage state, you can either:
403+
- Start with a user data directory using the `--user-data-dir` argument. This will persist all browser data between the sessions.
404+
- Start with a storage state file using the `--storage-state` argument. This will load cookies and local storage from the file into an isolated browser context.
405+
406+
For the page state, you can use:
407+
408+
- `--init-page` to point to a TypeScript file that will be evaluated on the Playwright page object. This allows you to run arbitrary code to set up the page.
409+
410+
```ts
411+
// init-page.ts
412+
export default async ({ page }) => {
413+
await page.context().grantPermissions(['geolocation']);
414+
await page.context().setGeolocation({ latitude: 37.7749, longitude: -122.4194 });
415+
await page.setViewportSize({ width: 1280, height: 720 });
416+
};
417+
```
418+
419+
- `--init-script` to point to a JavaScript file that will be added as an initialization script. The script will be evaluated in every page before any of the page's scripts.
420+
This is useful for overriding browser APIs or setting up the environment.
421+
422+
```js
423+
// init-script.js
424+
window.isPlaywrightMCP = true;
425+
```
426+
405427
### Configuration file
406428

407429
The Playwright MCP server can be configured using a JSON configuration file. You can specify the configuration file
@@ -708,6 +730,15 @@ http.createServer(async (req, res) => {
708730

709731
<!-- NOTE: This has been generated via update-readme.js -->
710732

733+
- **browser_run_code**
734+
- Title: Run Playwright code
735+
- Description: Run Playwright code snippet
736+
- Parameters:
737+
- `code` (string): Playwright code snippet to run. The snippet should access the `page` object to interact with the page. Can make multiple statements. For example: `await page.getByRole('button', { name: 'Submit' }).click();`
738+
- Read-only: **false**
739+
740+
<!-- NOTE: This has been generated via update-readme.js -->
741+
711742
- **browser_select_option**
712743
- Title: Select option
713744
- Description: Select an option in a dropdown

extension/manifest.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"manifest_version": 3,
33
"name": "Playwright MCP Bridge",
4-
"version": "0.0.46",
4+
"version": "0.0.47",
55
"description": "Share browser tabs with Playwright MCP server",
66
"key": "MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA9nMS2b0WCohjVHPGb8D9qAdkbIngDqoAjTeSccHJijgcONejge+OJxOQOMLu7b0ovt1c9BiEJa5JcpM+EHFVGL1vluBxK71zmBy1m2f9vZF3HG0LSCp7YRkum9rAIEthDwbkxx6XTvpmAY5rjFa/NON6b9Hlbo+8peUSkoOK7HTwYnnI36asZ9eUTiveIf+DMPLojW2UX33vDWG2UKvMVDewzclb4+uLxAYshY7Mx8we/b44xu+Anb/EBLKjOPk9Yh541xJ5Ozc8EiP/5yxOp9c/lRiYUHaRW+4r0HKZyFt0eZ52ti2iM4Nfk7jRXR7an3JPsUIf5deC/1cVM/+1ZQIDAQAB",
77
"permissions": [

extension/package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

extension/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@playwright/mcp-extension",
3-
"version": "0.0.46",
3+
"version": "0.0.47",
44
"description": "Playwright MCP Browser Extension",
55
"private": true,
66
"repository": {

package-lock.json

Lines changed: 16 additions & 16 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@playwright/mcp",
3-
"version": "0.0.46",
3+
"version": "0.0.47",
44
"description": "Playwright Tools for MCP",
55
"repository": {
66
"type": "git",
@@ -37,15 +37,15 @@
3737
}
3838
},
3939
"dependencies": {
40-
"playwright": "1.57.0-alpha-2025-11-07",
41-
"playwright-core": "1.57.0-alpha-2025-11-07"
40+
"playwright": "1.57.0-alpha-2025-11-14",
41+
"playwright-core": "1.57.0-alpha-2025-11-14"
4242
},
4343
"bin": {
4444
"mcp-server-playwright": "cli.js"
4545
},
4646
"devDependencies": {
4747
"@modelcontextprotocol/sdk": "^1.17.5",
48-
"@playwright/test": "1.57.0-alpha-2025-11-07",
48+
"@playwright/test": "1.57.0-alpha-2025-11-14",
4949
"@types/node": "^24.3.0",
5050
"zod-to-json-schema": "^3.24.6"
5151
}

tests/capabilities.spec.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ test('test snapshot tool list', async ({ client }) => {
3636
'browser_network_requests',
3737
'browser_press_key',
3838
'browser_resize',
39+
'browser_run_code',
3940
'browser_snapshot',
4041
'browser_tabs',
4142
'browser_take_screenshot',
@@ -67,6 +68,7 @@ test('test tool list proxy mode', async ({ startClient }) => {
6768
'browser_network_requests',
6869
'browser_press_key',
6970
'browser_resize',
71+
'browser_run_code',
7072
'browser_snapshot',
7173
'browser_tabs',
7274
'browser_take_screenshot',

0 commit comments

Comments
 (0)