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