From 1b5c91a9e4ed8aaecb552cbc7a90df3db092a661 Mon Sep 17 00:00:00 2001 From: Jesse Vincent Date: Tue, 14 May 2024 13:35:07 -0700 Subject: [PATCH] Update product status and enhance Logger utility - Updated `product-status.md` to include a note about Firefox support clarification. - Enhanced `Logger.js` in `src/renderer/utils` to handle call site detection across different browsers, improving compatibility and error tracking. - Added support for browsers without `Error.captureStackTrace`, specifically targeting Firefox for better error logging. --- product-status.md | 1 + src/renderer/utils/Logger.js | 8 ++++++++ 2 files changed, 9 insertions(+) diff --git a/product-status.md b/product-status.md index 4e44af65a..46421d3cf 100644 --- a/product-status.md +++ b/product-status.md @@ -30,6 +30,7 @@ _Note:_ On macOS, the Atreus and Model 01 may experience unreliable connectivity Chrysalis requires a browser with WebSerial support. Right now, this means Chrome, Edge, Arc, Brave, and other browsers based on Chromium. We're hopeful that Firefox and Apple will implement WebSerial and WebUSB, but neither browser maker has yet announced their intention to do so. ## Recent updates +- 2024-05-14: Fixup our firefox support to at least explain that we don't support firefox. - 2024-05-13: Update udev rules to match what we do in Kaleidoscope. - 2024-05-01: Properly handle changing dual-use layers from the layers tab. - 2024-03-18: Fixed an issue with the ability to edit sticky modifier keys diff --git a/src/renderer/utils/Logger.js b/src/renderer/utils/Logger.js index 4298c7cec..8fc5d0c15 100644 --- a/src/renderer/utils/Logger.js +++ b/src/renderer/utils/Logger.js @@ -44,8 +44,16 @@ class Logger { // Helper method to capture the call site getCallSite() { + // Chromeish browsers const err = new Error(); + if (Error.captureStackTrace) { Error.captureStackTrace(err, this.getCallSite); + } else { + // Firefox + // just pull from err.stack + } + + const stack = err?.stack.split("\n")[3]; // Extract and format call site from stack trace return stack?.trim()?.replace(/^at\s+/g, "");