@ejazullah/browser-mcp 0.0.63 → 0.0.64

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.
Files changed (2) hide show
  1. package/lib/program.js +20 -0
  2. package/package.json +1 -1
package/lib/program.js CHANGED
@@ -137,5 +137,25 @@ function setupExitWatchdog() {
137
137
  process.stdin.on('close', handleExit);
138
138
  process.on('SIGINT', handleExit);
139
139
  process.on('SIGTERM', handleExit);
140
+ const isSharedWorkerError = (err) => {
141
+ const msg = err?.message || String(err || '');
142
+ return msg.includes('shared_worker targets are not supported yet') || err?.targetInfo?.type === 'shared_worker' || msg.includes('type: "shared_worker"');
143
+ };
144
+ process.on('uncaughtException', (err) => {
145
+ if (isSharedWorkerError(err)) {
146
+ console.warn('[mcp] Ignoring Playwright shared_worker assertion error to prevent crash.');
147
+ return;
148
+ }
149
+ console.error('Uncaught Exception:', err);
150
+ process.exit(1);
151
+ });
152
+ process.on('unhandledRejection', (err) => {
153
+ if (isSharedWorkerError(err)) {
154
+ console.warn('[mcp] Ignoring Playwright shared_worker assertion error to prevent crash.');
155
+ return;
156
+ }
157
+ console.error('Unhandled Rejection:', err);
158
+ process.exit(1);
159
+ });
140
160
  }
141
161
  void program.parseAsync(process.argv);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ejazullah/browser-mcp",
3
- "version": "0.0.63",
3
+ "version": "0.0.64",
4
4
  "description": "@ejazullah/browser-mcp - Enhanced Playwright Tools for MCP with CDP Support",
5
5
  "type": "module",
6
6
  "repository": {