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