@newtalaria/browser 0.1.7 → 0.1.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -17,6 +17,14 @@
17
17
  return `${hex.slice(0, 8)}-${hex.slice(8, 12)}-${hex.slice(12, 16)}-${hex.slice(16, 20)}-${hex.slice(20)}`;
18
18
  }
19
19
 
20
+ // src/utils/opaque_script_error.ts
21
+ function isOpaqueCrossOriginScriptError(event) {
22
+ const msg = (event.message ?? "").trim();
23
+ if (!/^script error\.?$/i.test(msg)) return false;
24
+ if (event.error instanceof Error) return false;
25
+ return true;
26
+ }
27
+
20
28
  // src/transport/serverpod.ts
21
29
  var ServerpodTransport = class {
22
30
  constructor(options) {
@@ -13925,6 +13933,7 @@
13925
13933
  installGlobalHandlers() {
13926
13934
  if (typeof window === "undefined") return;
13927
13935
  const onError = (event) => {
13936
+ if (isOpaqueCrossOriginScriptError(event)) return;
13928
13937
  const error = event.error instanceof Error ? event.error : new Error(event.message || "window.onerror");
13929
13938
  void this.captureException(error, {
13930
13939
  extra: {