diff --git a/src/App.vue b/src/App.vue index 36c4b58a3..d8600aa87 100644 --- a/src/App.vue +++ b/src/App.vue @@ -87,9 +87,18 @@ window.onerror = (msg, url, line, col, error) => { return suppressErrorAlert; }; +function isBrowserExtensionUnhandledRejection(reason) { + const stack = reason instanceof Error ? reason.stack : ""; + return typeof stack === "string" && stack.includes("chrome-extension://"); +} + // Log Promise rejections that are never handled (.catch / await try/catch), e.g. fire-and-forget async. window.addEventListener("unhandledrejection", (event) => { const reason = event.reason; + if (isBrowserExtensionUnhandledRejection(reason)) { + return; + } + const message = reason instanceof Error ? reason.message : String(reason); global.$logger.logError(`unhandledrejection: ${message}`, { stack: reason instanceof Error ? reason.stack : undefined,