@cotestdev/mcp_playwright 0.0.26 → 0.0.27

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -178,8 +178,12 @@ class Context {
178
178
  const result = await this._browserContextFactory.createContext(this._clientInfo, this._abortController.signal, this._runningToolName);
179
179
  const { browserContext } = result;
180
180
  if (!this.config.allowUnrestrictedFileAccess) {
181
- browserContext._setAllowedProtocols(["http:", "https:", "about:", "data:"]);
182
- browserContext._setAllowedDirectories(allRootPaths(this._clientInfo));
181
+ if (typeof browserContext._setAllowedProtocols === "function") {
182
+ browserContext._setAllowedProtocols(["http:", "https:", "about:", "data:"]);
183
+ }
184
+ if (typeof browserContext._setAllowedDirectories === "function") {
185
+ browserContext._setAllowedDirectories(allRootPaths(this._clientInfo));
186
+ }
183
187
  }
184
188
  await this._setupRequestInterception(browserContext);
185
189
  if (this.sessionLog)
@@ -73,7 +73,7 @@ const runCode = (0, import_tool.defineTabTool)({
73
73
  });
74
74
  }
75
75
  });
76
- const scriptSchema = import_common.baseSchema.extend({
76
+ const scriptSchema = import_mcpBundle.z.object({
77
77
  code: import_mcpBundle.z.string().describe(`A Typescript function containing Playwright code to execute. It will be invoked with a single argument, page, which you can use for any page interaction. For example: \`async (page) => { await page.getByRole('button', { name: 'Submit' }).click(); return await page.title(); }\``),
78
78
  params: import_mcpBundle.z.record(import_mcpBundle.z.any()).optional().describe("Parameters to pass to the script.")
79
79
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cotestdev/mcp_playwright",
3
- "version": "0.0.26",
3
+ "version": "0.0.27",
4
4
  "description": "Playwright MCP (Model Context Protocol) tools for browser automation",
5
5
  "main": "lib/index.js",
6
6
  "types": "lib/index.d.ts",