From 5b80824f1765c1fbdb0c171f96467a65cb3fbd8d Mon Sep 17 00:00:00 2001 From: Matt Sykes Date: Mon, 22 Jun 2026 17:00:03 -0400 Subject: [PATCH] Avoid logging unhandledRejection with browser extensions in stack trace --- src/App.vue | 9 +++++++++ 1 file changed, 9 insertions(+) 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,