humanbehavior-js 0.4.21 → 0.4.22

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.
@@ -13848,7 +13848,7 @@ class HumanBehaviorTracker {
13848
13848
  var _a;
13849
13849
  // ✅ SUPPRESS COMMON RRWEB ERRORS FOR CLEAN CONSOLE
13850
13850
  if (isBrowser && (options === null || options === void 0 ? void 0 : options.suppressConsoleErrors) !== false) {
13851
- // Suppress canvas security errors
13851
+ // Suppress canvas security errors and network errors
13852
13852
  const originalConsoleError = console.error;
13853
13853
  console.error = (...args) => {
13854
13854
  const message = args.join(' ');
@@ -13859,8 +13859,14 @@ class HumanBehaviorTracker {
13859
13859
  message.includes('CORS') ||
13860
13860
  message.includes('Access-Control-Allow-Origin') ||
13861
13861
  message.includes('Failed to load resource') ||
13862
- message.includes('net::ERR_BLOCKED_BY_CLIENT')) {
13863
- // Silently suppress these common rrweb errors
13862
+ message.includes('net::ERR_BLOCKED_BY_CLIENT') ||
13863
+ message.includes('NetworkError when attempting to fetch resource') ||
13864
+ message.includes('Failed to fetch') ||
13865
+ message.includes('TypeError: NetworkError') ||
13866
+ message.includes('HumanBehavior ERROR') ||
13867
+ message.includes('Failed to track custom event') ||
13868
+ message.includes('Error sending custom event')) {
13869
+ // Silently suppress these common errors
13864
13870
  return;
13865
13871
  }
13866
13872
  originalConsoleError.apply(console, args);
@@ -13874,8 +13880,12 @@ class HumanBehaviorTracker {
13874
13880
  message.includes('CORS') ||
13875
13881
  message.includes('Access-Control-Allow-Origin') ||
13876
13882
  message.includes('Failed to load resource') ||
13877
- message.includes('net::ERR_BLOCKED_BY_CLIENT')) {
13878
- // Silently suppress these common rrweb warnings
13883
+ message.includes('net::ERR_BLOCKED_BY_CLIENT') ||
13884
+ message.includes('NetworkError when attempting to fetch resource') ||
13885
+ message.includes('Failed to fetch') ||
13886
+ message.includes('Custom event network error') ||
13887
+ message.includes('Request blocked by ad blocker')) {
13888
+ // Silently suppress these common warnings
13879
13889
  return;
13880
13890
  }
13881
13891
  originalConsoleWarn.apply(console, args);
@@ -13887,7 +13897,9 @@ class HumanBehaviorTracker {
13887
13897
  message.includes('Tainted canvases') ||
13888
13898
  message.includes('toDataURL') ||
13889
13899
  message.includes('Cross-Origin') ||
13890
- message.includes('CORS')) {
13900
+ message.includes('CORS') ||
13901
+ message.includes('NetworkError') ||
13902
+ message.includes('Failed to fetch')) {
13891
13903
  event.preventDefault();
13892
13904
  return false;
13893
13905
  }