Fix context menu duplicate ID crash and add global error logging
This commit is contained in:
@@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"manifest_version": 3,
|
"manifest_version": 3,
|
||||||
"name": "Playwriter MCP",
|
"name": "Playwriter MCP",
|
||||||
"version": "0.0.59",
|
"version": "0.0.61",
|
||||||
"description": "Automate your Browser using Cursor, Claude, VS Code. More capable and context efficient than Playwright MCP.",
|
"description": "Automate your Browser using Cursor, Claude, VS Code. More capable and context efficient than Playwright MCP.",
|
||||||
"permissions": ["debugger", "tabGroups", "contextMenus", "tabs"],
|
"permissions": ["debugger", "tabGroups", "contextMenus", "tabs"],
|
||||||
"host_permissions": ["<all_urls>"],
|
"host_permissions": ["<all_urls>"],
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "mcp-extension",
|
"name": "mcp-extension",
|
||||||
"version": "0.0.55",
|
"version": "0.0.61",
|
||||||
"description": "Playwright MCP Browser Extension",
|
"description": "Playwright MCP Browser Extension",
|
||||||
"private": true,
|
"private": true,
|
||||||
"repository": {
|
"repository": {
|
||||||
|
|||||||
@@ -94,6 +94,18 @@ const logger = {
|
|||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
|
self.addEventListener('error', (event) => {
|
||||||
|
const error = event.error
|
||||||
|
const stack = error?.stack || `${event.message} at ${event.filename}:${event.lineno}:${event.colno}`
|
||||||
|
logger.error('Uncaught error:', stack)
|
||||||
|
})
|
||||||
|
|
||||||
|
self.addEventListener('unhandledrejection', (event) => {
|
||||||
|
const reason = event.reason
|
||||||
|
const stack = reason?.stack || String(reason)
|
||||||
|
logger.error('Unhandled promise rejection:', stack)
|
||||||
|
})
|
||||||
|
|
||||||
function sendMessage(message: any): void {
|
function sendMessage(message: any): void {
|
||||||
if (ws?.readyState === WebSocket.OPEN) {
|
if (ws?.readyState === WebSocket.OPEN) {
|
||||||
try {
|
try {
|
||||||
@@ -945,6 +957,7 @@ async function onActionClicked(tab: chrome.tabs.Tab): Promise<void> {
|
|||||||
|
|
||||||
resetDebugger()
|
resetDebugger()
|
||||||
|
|
||||||
|
chrome.contextMenus.remove('playwriter-pin-element').catch(() => {})
|
||||||
chrome.contextMenus.create({
|
chrome.contextMenus.create({
|
||||||
id: 'playwriter-pin-element',
|
id: 'playwriter-pin-element',
|
||||||
title: 'Copy Playwriter Element Reference',
|
title: 'Copy Playwriter Element Reference',
|
||||||
|
|||||||
Reference in New Issue
Block a user