@amplitude/session-replay-browser
Advanced tools
Comparing version 1.11.2 to 1.11.3
@@ -90,3 +90,3 @@ var _this = this; | ||
} | ||
if (samplingConfig.sample_rate) { | ||
if (Object.prototype.hasOwnProperty.call(samplingConfig, 'sample_rate')) { | ||
config.sampleRate = samplingConfig.sample_rate; | ||
@@ -93,0 +93,0 @@ } |
@@ -38,3 +38,3 @@ import { Logger as ILogger } from '@amplitude/analytics-types'; | ||
shouldOptOut(): boolean | undefined; | ||
getShouldRecord(ignoreFocus?: boolean): boolean; | ||
getShouldRecord(): boolean; | ||
getBlockSelectors(): string | string[] | undefined; | ||
@@ -41,0 +41,0 @@ getMaskTextSelectors(): string | undefined; |
@@ -109,3 +109,3 @@ Object.defineProperty(exports, "__esModule", { value: true }); | ||
return tslib_1.__awaiter(this, void 0, void 0, function () { | ||
var _d, _e, scrollWatcher, managers, rrwebEventManager, interactionEventManager, globalScope; | ||
var _d, _e, scrollWatcher, managers, rrwebEventManager, interactionEventManager, globalScope, ignoreFocus; | ||
return tslib_1.__generator(this, function (_f) { | ||
@@ -163,3 +163,4 @@ switch (_f.label) { | ||
globalScope = (0, analytics_client_common_1.getGlobalScope)(); | ||
if (globalScope && globalScope.document && globalScope.document.hasFocus()) { | ||
ignoreFocus = !!this.config.debugMode; | ||
if (!ignoreFocus && globalScope && globalScope.document && globalScope.document.hasFocus()) { | ||
this.initialize(true); | ||
@@ -218,6 +219,3 @@ } | ||
} | ||
// If the user is in debug mode, ignore the focus handler when tagging events. | ||
// this is a common mishap when someone is developing locally and not seeing events getting tagged. | ||
var ignoreFocus = !!this.config.debugMode; | ||
var shouldRecord = this.getShouldRecord(ignoreFocus); | ||
var shouldRecord = this.getShouldRecord(); | ||
if (shouldRecord) { | ||
@@ -268,4 +266,3 @@ var eventProperties = (_a = {}, | ||
}; | ||
SessionReplay.prototype.getShouldRecord = function (ignoreFocus) { | ||
if (ignoreFocus === void 0) { ignoreFocus = false; } | ||
SessionReplay.prototype.getShouldRecord = function () { | ||
if (!this.identifiers || !this.config || !this.identifiers.sessionId) { | ||
@@ -280,2 +277,5 @@ this.loggerProvider.warn("Session is not being recorded due to lack of config, please call sessionReplay.init."); | ||
var globalScope = (0, analytics_client_common_1.getGlobalScope)(); | ||
// If the user is in debug mode, ignore the focus handler when tagging events. | ||
// this is a common mishap when someone is developing locally and not seeing events getting tagged. | ||
var ignoreFocus = !!this.config.debugMode; | ||
if (!ignoreFocus && globalScope && globalScope.document && !globalScope.document.hasFocus()) { | ||
@@ -282,0 +282,0 @@ this.loggerProvider.log("Session ".concat(this.identifiers.sessionId, " temporarily not recording due to lack of browser focus.")); |
@@ -87,3 +87,3 @@ import { __assign, __awaiter, __generator, __read, __values } from "tslib"; | ||
} | ||
if (samplingConfig.sample_rate) { | ||
if (Object.prototype.hasOwnProperty.call(samplingConfig, 'sample_rate')) { | ||
config.sampleRate = samplingConfig.sample_rate; | ||
@@ -90,0 +90,0 @@ } |
@@ -38,3 +38,3 @@ import { Logger as ILogger } from '@amplitude/analytics-types'; | ||
shouldOptOut(): boolean | undefined; | ||
getShouldRecord(ignoreFocus?: boolean): boolean; | ||
getShouldRecord(): boolean; | ||
getBlockSelectors(): string | string[] | undefined; | ||
@@ -41,0 +41,0 @@ getMaskTextSelectors(): string | undefined; |
@@ -107,3 +107,3 @@ import { __awaiter, __generator, __read, __spreadArray } from "tslib"; | ||
return __awaiter(this, void 0, void 0, function () { | ||
var _d, _e, scrollWatcher, managers, rrwebEventManager, interactionEventManager, globalScope; | ||
var _d, _e, scrollWatcher, managers, rrwebEventManager, interactionEventManager, globalScope, ignoreFocus; | ||
return __generator(this, function (_f) { | ||
@@ -161,3 +161,4 @@ switch (_f.label) { | ||
globalScope = getGlobalScope(); | ||
if (globalScope && globalScope.document && globalScope.document.hasFocus()) { | ||
ignoreFocus = !!this.config.debugMode; | ||
if (!ignoreFocus && globalScope && globalScope.document && globalScope.document.hasFocus()) { | ||
this.initialize(true); | ||
@@ -216,6 +217,3 @@ } | ||
} | ||
// If the user is in debug mode, ignore the focus handler when tagging events. | ||
// this is a common mishap when someone is developing locally and not seeing events getting tagged. | ||
var ignoreFocus = !!this.config.debugMode; | ||
var shouldRecord = this.getShouldRecord(ignoreFocus); | ||
var shouldRecord = this.getShouldRecord(); | ||
if (shouldRecord) { | ||
@@ -266,4 +264,3 @@ var eventProperties = (_a = {}, | ||
}; | ||
SessionReplay.prototype.getShouldRecord = function (ignoreFocus) { | ||
if (ignoreFocus === void 0) { ignoreFocus = false; } | ||
SessionReplay.prototype.getShouldRecord = function () { | ||
if (!this.identifiers || !this.config || !this.identifiers.sessionId) { | ||
@@ -278,2 +275,5 @@ this.loggerProvider.warn("Session is not being recorded due to lack of config, please call sessionReplay.init."); | ||
var globalScope = getGlobalScope(); | ||
// If the user is in debug mode, ignore the focus handler when tagging events. | ||
// this is a common mishap when someone is developing locally and not seeing events getting tagged. | ||
var ignoreFocus = !!this.config.debugMode; | ||
if (!ignoreFocus && globalScope && globalScope.document && !globalScope.document.hasFocus()) { | ||
@@ -280,0 +280,0 @@ this.loggerProvider.log("Session ".concat(this.identifiers.sessionId, " temporarily not recording due to lack of browser focus.")); |
@@ -38,3 +38,3 @@ import { Logger as ILogger } from '@amplitude/analytics-types'; | ||
shouldOptOut(): boolean | undefined; | ||
getShouldRecord(ignoreFocus?: boolean): boolean; | ||
getShouldRecord(): boolean; | ||
getBlockSelectors(): string | string[] | undefined; | ||
@@ -41,0 +41,0 @@ getMaskTextSelectors(): string | undefined; |
{ | ||
"name": "@amplitude/session-replay-browser", | ||
"version": "1.11.2", | ||
"version": "1.11.3", | ||
"description": "", | ||
@@ -43,3 +43,3 @@ "author": "Amplitude Inc", | ||
"@amplitude/analytics-core": ">=1 <3", | ||
"@amplitude/analytics-remote-config": "^0.3.2", | ||
"@amplitude/analytics-remote-config": "^0.3.3", | ||
"@amplitude/analytics-types": ">=1 <3", | ||
@@ -67,3 +67,3 @@ "@amplitude/rrweb": "^2.0.0-alpha.14", | ||
], | ||
"gitHead": "a009dfa144d0b616326c9a26a8348ee5678f581a" | ||
"gitHead": "1eeb614788a782d235bb7cbb97aee0dc16a7f20a" | ||
} |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Native code
Supply chain riskContains native code (e.g., compiled binaries or shared libraries). Including native code can obscure malicious behavior.
Found 2 instances in 1 package
1001975
10
+ Addednanoid@3.3.7(transitive)
- Removednanoid@3.3.8(transitive)