From eff533374dcff479d3f9d953cb41881157948d48 Mon Sep 17 00:00:00 2001 From: Andrey Antukh Date: Mon, 8 Jun 2026 10:05:09 +0000 Subject: [PATCH] :bug: Ignore Safari browser extension errors in error handler Add detection for Safari's webkit-masked-url:// extension URLs and filter the "Attempting to change value of a readonly property" TypeError to prevent Safari browser extension errors from being surfaced to users. Signed-off-by: Andrey Antukh --- frontend/src/app/main/errors.cljs | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/frontend/src/app/main/errors.cljs b/frontend/src/app/main/errors.cljs index 7891c166f0..c79358a0b8 100644 --- a/frontend/src/app/main/errors.cljs +++ b/frontend/src/app/main/errors.cljs @@ -436,7 +436,10 @@ (let [stack (.-stack cause)] (and (string? stack) (or (str/includes? stack "chrome-extension://") - (str/includes? stack "moz-extension://"))))) + (str/includes? stack "moz-extension://") + ;; Safari/WebKit masks extension and Web Inspector URLs + ;; with this internal scheme. + (str/includes? stack "webkit-masked-url://"))))) (defn- from-posthog? "True when the error stack trace originates from PostHog analytics." @@ -471,6 +474,14 @@ ;; TypeError. This is a known Zone.js / browser-extension ;; incompatibility and is NOT a Penpot bug. (str/starts-with? message "Cannot assign to read only property 'toString'") + ;; Safari TypeError: "Attempting to change value of a readonly + ;; property". Raised when browser extensions or Web Inspector + ;; devtools (e.g., jsonPrune) try to mutate ClojureScript's + ;; immutable data structures via Object.defineProperty. + ;; ClojureScript defines getter-only properties on its maps + ;; and records, making them readonly. This is NOT a Penpot bug. + (and (= (.-name ^js cause) "TypeError") + (= message "Attempting to change value of a readonly property")) ;; NotFoundError DOMException: "Failed to execute ;; 'removeChild' on 'Node'" — Thrown by React's commit ;; phase when the DOM tree has been modified externally