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