humanbehavior-js 0.4.10 → 0.4.12
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/clean-console-demo.html +39 -0
- package/dist/cjs/angular/index.cjs +52 -15
- package/dist/cjs/angular/index.cjs.map +1 -1
- package/dist/cjs/index.cjs +52 -15
- package/dist/cjs/index.cjs.map +1 -1
- package/dist/cjs/react/index.cjs +52 -15
- package/dist/cjs/react/index.cjs.map +1 -1
- package/dist/cjs/remix/index.cjs +52 -15
- package/dist/cjs/remix/index.cjs.map +1 -1
- package/dist/cjs/svelte/index.cjs +52 -15
- package/dist/cjs/svelte/index.cjs.map +1 -1
- package/dist/cjs/vue/index.cjs +52 -15
- package/dist/cjs/vue/index.cjs.map +1 -1
- package/dist/cli/ai-auto-install.js +0 -0
- package/dist/esm/angular/index.js +52 -15
- package/dist/esm/angular/index.js.map +1 -1
- package/dist/esm/index.js +52 -15
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/react/index.js +52 -15
- package/dist/esm/react/index.js.map +1 -1
- package/dist/esm/remix/index.js +52 -15
- package/dist/esm/remix/index.js.map +1 -1
- package/dist/esm/svelte/index.js +52 -15
- package/dist/esm/svelte/index.js.map +1 -1
- package/dist/esm/vue/index.js +52 -15
- package/dist/esm/vue/index.js.map +1 -1
- package/dist/index.min.js +1 -1
- package/dist/index.min.js.map +1 -1
- package/dist/types/angular/index.d.ts +1 -0
- package/dist/types/index.d.ts +1 -0
- package/dist/types/react/index.d.ts +1 -0
- package/dist/types/remix/index.d.ts +1 -0
- package/dist/types/svelte/index.d.ts +1 -0
- package/package.json +1 -1
- package/readme.md +26 -2
- package/src/tracker.ts +61 -17
package/dist/esm/react/index.js
CHANGED
|
@@ -13171,6 +13171,53 @@ class HumanBehaviorTracker {
|
|
|
13171
13171
|
* This is the main entry point - call this once per page
|
|
13172
13172
|
*/
|
|
13173
13173
|
static init(apiKey, options) {
|
|
13174
|
+
// ✅ SUPPRESS COMMON RRWEB ERRORS FOR CLEAN CONSOLE
|
|
13175
|
+
if (isBrowser$1 && (options === null || options === void 0 ? void 0 : options.suppressConsoleErrors) !== false) {
|
|
13176
|
+
// Suppress canvas security errors
|
|
13177
|
+
const originalConsoleError = console.error;
|
|
13178
|
+
console.error = (...args) => {
|
|
13179
|
+
const message = args.join(' ');
|
|
13180
|
+
if (message.includes('SecurityError: Failed to execute \'toDataURL\'') ||
|
|
13181
|
+
message.includes('Tainted canvases may not be exported') ||
|
|
13182
|
+
message.includes('Cannot inline img src=') ||
|
|
13183
|
+
message.includes('Cross-Origin') ||
|
|
13184
|
+
message.includes('CORS') ||
|
|
13185
|
+
message.includes('Access-Control-Allow-Origin') ||
|
|
13186
|
+
message.includes('Failed to load resource') ||
|
|
13187
|
+
message.includes('net::ERR_BLOCKED_BY_CLIENT')) {
|
|
13188
|
+
// Silently suppress these common rrweb errors
|
|
13189
|
+
return;
|
|
13190
|
+
}
|
|
13191
|
+
originalConsoleError.apply(console, args);
|
|
13192
|
+
};
|
|
13193
|
+
// Suppress console.warn for similar issues
|
|
13194
|
+
const originalConsoleWarn = console.warn;
|
|
13195
|
+
console.warn = (...args) => {
|
|
13196
|
+
const message = args.join(' ');
|
|
13197
|
+
if (message.includes('Cannot inline img src=') ||
|
|
13198
|
+
message.includes('Cross-Origin') ||
|
|
13199
|
+
message.includes('CORS') ||
|
|
13200
|
+
message.includes('Access-Control-Allow-Origin') ||
|
|
13201
|
+
message.includes('Failed to load resource') ||
|
|
13202
|
+
message.includes('net::ERR_BLOCKED_BY_CLIENT')) {
|
|
13203
|
+
// Silently suppress these common rrweb warnings
|
|
13204
|
+
return;
|
|
13205
|
+
}
|
|
13206
|
+
originalConsoleWarn.apply(console, args);
|
|
13207
|
+
};
|
|
13208
|
+
// Add global error handler for any remaining rrweb errors
|
|
13209
|
+
window.addEventListener('error', (event) => {
|
|
13210
|
+
const message = event.message || '';
|
|
13211
|
+
if (message.includes('SecurityError') ||
|
|
13212
|
+
message.includes('Tainted canvases') ||
|
|
13213
|
+
message.includes('toDataURL') ||
|
|
13214
|
+
message.includes('Cross-Origin') ||
|
|
13215
|
+
message.includes('CORS')) {
|
|
13216
|
+
event.preventDefault();
|
|
13217
|
+
return false;
|
|
13218
|
+
}
|
|
13219
|
+
});
|
|
13220
|
+
}
|
|
13174
13221
|
// Return existing instance if already initialized
|
|
13175
13222
|
if (isBrowser$1 && window.__humanBehaviorGlobalTracker) {
|
|
13176
13223
|
logDebug('Tracker already initialized, returning existing instance');
|
|
@@ -13192,16 +13239,6 @@ class HumanBehaviorTracker {
|
|
|
13192
13239
|
if ((options === null || options === void 0 ? void 0 : options.enableAutomaticTracking) !== false) {
|
|
13193
13240
|
tracker.setupAutomaticTracking(options === null || options === void 0 ? void 0 : options.automaticTrackingOptions);
|
|
13194
13241
|
}
|
|
13195
|
-
// Test connection (non-blocking)
|
|
13196
|
-
if (isBrowser$1) {
|
|
13197
|
-
const testUrl = tracker.api['baseUrl'] + '/api/health';
|
|
13198
|
-
fetch(testUrl, { method: 'HEAD' })
|
|
13199
|
-
.then(() => logDebug('Connection test successful'))
|
|
13200
|
-
.catch((error) => {
|
|
13201
|
-
logWarn('Connection test failed - ad blocker may be active:', error.message);
|
|
13202
|
-
tracker._connectionBlocked = true;
|
|
13203
|
-
});
|
|
13204
|
-
}
|
|
13205
13242
|
// Start tracking
|
|
13206
13243
|
tracker.start();
|
|
13207
13244
|
return tracker;
|
|
@@ -13810,11 +13847,11 @@ class HumanBehaviorTracker {
|
|
|
13810
13847
|
maskInputOptions: { password: true }, // HumanBehavior default
|
|
13811
13848
|
maskInputFn: undefined,
|
|
13812
13849
|
slimDOMOptions: {},
|
|
13813
|
-
|
|
13814
|
-
|
|
13815
|
-
|
|
13816
|
-
|
|
13817
|
-
recordCanvas: false, // Disabled to prevent large data URIs
|
|
13850
|
+
// ✅ ERROR SUPPRESSION SETTINGS - Disabled to prevent console noise
|
|
13851
|
+
collectFonts: false, // Disable font collection to reduce errors
|
|
13852
|
+
inlineStylesheet: true, // Keep styles for proper session replay
|
|
13853
|
+
recordCrossOriginIframes: false, // Prevent cross-origin iframe errors
|
|
13854
|
+
recordCanvas: false, // Disabled to prevent large data URIs and canvas errors
|
|
13818
13855
|
// ✅ FULLSNAPSHOT GENERATION - No periodic snapshots to avoid animation issues
|
|
13819
13856
|
// Rely on initial FullSnapshot + navigation-triggered ones only
|
|
13820
13857
|
});
|