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