@coralogix/browser 3.19.2 → 3.21.0
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/CHANGELOG.md +37 -0
- package/index.esm2.js +186 -92
- package/package.json +1 -1
- package/sessionRecorder.esm.js +18 -10
- package/src/constants.d.ts +1 -0
- package/src/cx-rrweb/rrweb/utils.d.ts +2 -3
- package/src/cx-rrweb/rrweb-types/index.d.ts +32 -7
- package/src/cx-rrweb/rrweb-utils/index.d.ts +4 -1
- package/src/dom-attributes.consts.d.ts +0 -2
- package/src/instrumentations/user-interaction/user-interaction.utils.d.ts +2 -3
- package/src/otel/rum-span-attributes.types.d.ts +1 -0
- package/src/tools/cx-timers.d.ts +1 -0
- package/src/types.d.ts +3 -0
- package/src/utils/all.d.ts +1 -0
- package/src/version.d.ts +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,40 @@
|
|
|
1
|
+
## 3.21.0 (2026-08-09)
|
|
2
|
+
|
|
3
|
+
### 🚀 Features
|
|
4
|
+
|
|
5
|
+
- Upgrade the session recording engine to rrweb 2.1.1
|
|
6
|
+
|
|
7
|
+
### 🩹 Fixes
|
|
8
|
+
|
|
9
|
+
- Keep session recording working when another library on the page replaces `MutationObserver`
|
|
10
|
+
- Record style changes correctly for CSS rules nested inside `@media` / `@supports`
|
|
11
|
+
- Prevent recording errors on browsers without WebGL support
|
|
12
|
+
- Resolve `url()` references that contain a fragment in captured stylesheets
|
|
13
|
+
|
|
14
|
+
## 3.20.1 (2026-07-28)
|
|
15
|
+
|
|
16
|
+
### 🩹 Fixes
|
|
17
|
+
|
|
18
|
+
- Improve user-interaction tracking for product analytics
|
|
19
|
+
|
|
20
|
+
## 3.20.0 (2026-07-21)
|
|
21
|
+
|
|
22
|
+
### 🚀 Features
|
|
23
|
+
|
|
24
|
+
- Add Proofpoint env
|
|
25
|
+
|
|
26
|
+
## 3.19.4 (2026-07-20)
|
|
27
|
+
|
|
28
|
+
### 🩹 Fixes
|
|
29
|
+
|
|
30
|
+
- Improve dead-click handling and referrer path resolution
|
|
31
|
+
|
|
32
|
+
## 3.19.3 (2026-07-14)
|
|
33
|
+
|
|
34
|
+
### 🩹 Fixes
|
|
35
|
+
|
|
36
|
+
- Improve action-name attribute detection in nested elements
|
|
37
|
+
|
|
1
38
|
## 3.19.2 (2026-07-13)
|
|
2
39
|
|
|
3
40
|
### 🩹 Fixes
|
package/index.esm2.js
CHANGED
|
@@ -1477,10 +1477,56 @@ function cxCancelAnimationFrame(id) {
|
|
|
1477
1477
|
var originalCaf = getZoneJsOriginalDom(browserWindow, 'cancelAnimationFrame');
|
|
1478
1478
|
originalCaf.call(browserWindow, id);
|
|
1479
1479
|
}
|
|
1480
|
+
var RR_BLOCK_CLASS = 'rr-block';
|
|
1481
|
+
var untaintedMutationObserver;
|
|
1482
|
+
function isNativeFunction(fn) {
|
|
1483
|
+
try {
|
|
1484
|
+
return (typeof fn === 'function' &&
|
|
1485
|
+
Function.prototype.toString.call(fn).indexOf('[native code]') !== -1);
|
|
1486
|
+
}
|
|
1487
|
+
catch (_a) {
|
|
1488
|
+
return false;
|
|
1489
|
+
}
|
|
1490
|
+
}
|
|
1491
|
+
function getUntaintedMutationObserver() {
|
|
1492
|
+
if (untaintedMutationObserver !== undefined) {
|
|
1493
|
+
return untaintedMutationObserver;
|
|
1494
|
+
}
|
|
1495
|
+
var doc = getBrowserWindow().document;
|
|
1496
|
+
if (!doc || !doc.body) {
|
|
1497
|
+
return null;
|
|
1498
|
+
}
|
|
1499
|
+
untaintedMutationObserver = null;
|
|
1500
|
+
try {
|
|
1501
|
+
var iframe = doc.createElement('iframe');
|
|
1502
|
+
iframe.style.display = 'none';
|
|
1503
|
+
iframe.setAttribute('aria-hidden', 'true');
|
|
1504
|
+
iframe.className = RR_BLOCK_CLASS;
|
|
1505
|
+
doc.body.appendChild(iframe);
|
|
1506
|
+
var frameWindow = iframe.contentWindow;
|
|
1507
|
+
var frameCtor = frameWindow === null || frameWindow === void 0 ? void 0 : frameWindow['MutationObserver'];
|
|
1508
|
+
if (typeof frameCtor === 'function') {
|
|
1509
|
+
untaintedMutationObserver = frameCtor;
|
|
1510
|
+
}
|
|
1511
|
+
else {
|
|
1512
|
+
iframe.remove();
|
|
1513
|
+
}
|
|
1514
|
+
}
|
|
1515
|
+
catch (_a) {
|
|
1516
|
+
}
|
|
1517
|
+
return untaintedMutationObserver;
|
|
1518
|
+
}
|
|
1480
1519
|
function createCxMutationObserver(callback) {
|
|
1481
1520
|
var browserWindow = getBrowserWindow();
|
|
1521
|
+
if (!shouldRunOutsideZone()) {
|
|
1522
|
+
return new browserWindow.MutationObserver(callback);
|
|
1523
|
+
}
|
|
1482
1524
|
var OriginalMutationObserver = getZoneJsOriginalDom(browserWindow, 'MutationObserver');
|
|
1483
|
-
|
|
1525
|
+
if (isNativeFunction(OriginalMutationObserver)) {
|
|
1526
|
+
return new OriginalMutationObserver(callback);
|
|
1527
|
+
}
|
|
1528
|
+
var UntaintedMutationObserver = getUntaintedMutationObserver();
|
|
1529
|
+
return new (UntaintedMutationObserver !== null && UntaintedMutationObserver !== void 0 ? UntaintedMutationObserver : OriginalMutationObserver)(callback);
|
|
1484
1530
|
}
|
|
1485
1531
|
function cxRunOutsideZone(fn) {
|
|
1486
1532
|
if (!shouldRunOutsideZone()) {
|
|
@@ -2144,8 +2190,6 @@ function addEventListeners(eventTarget, eventNames, listener, _a) {
|
|
|
2144
2190
|
|
|
2145
2191
|
var CX_ACTION_NAME_ATTRIBUTE = 'data-cx-action-name';
|
|
2146
2192
|
var DATA_TEST_ATTRIBUTE = 'data-test';
|
|
2147
|
-
var DATA_TESTID_ATTRIBUTE = 'data-testid';
|
|
2148
|
-
var DATA_TEST_ID_ATTRIBUTE = 'data-test-id';
|
|
2149
2193
|
var RR_IS_PASSWORD_ATTRIBUTE = 'data-rr-is-password';
|
|
2150
2194
|
|
|
2151
2195
|
var knownPasswordInputs = new WeakSet();
|
|
@@ -2197,15 +2241,18 @@ function handleMutations(mutations) {
|
|
|
2197
2241
|
}
|
|
2198
2242
|
}
|
|
2199
2243
|
|
|
2200
|
-
var
|
|
2244
|
+
var ANCESTOR_SEARCH_DEPTH = 5;
|
|
2201
2245
|
var POINTER_CURSOR = 'pointer';
|
|
2246
|
+
var TEXT_CURSOR = 'text';
|
|
2247
|
+
var BODY_NODE_NAME = 'BODY';
|
|
2202
2248
|
var CLICKABLE_SELECTOR = 'a, button, input, select, textarea, label, summary, option, li, ' +
|
|
2203
2249
|
'[role="button"], [role="link"], [role="tab"], ' +
|
|
2204
2250
|
'[role="menuitem"], [role="menuitemcheckbox"], [role="menuitemradio"], ' +
|
|
2205
2251
|
'[role="checkbox"], [role="radio"], [role="switch"], ' +
|
|
2206
|
-
'[role="option"], [role="combobox"]'
|
|
2252
|
+
'[role="option"], [role="combobox"], [contenteditable]:not([contenteditable="false"]), ' +
|
|
2253
|
+
'[role="textbox"], [role="searchbox"], [role="combobox"]';
|
|
2207
2254
|
function getAttributeFromAncestors(element, attr, depth) {
|
|
2208
|
-
if (depth === void 0) { depth =
|
|
2255
|
+
if (depth === void 0) { depth = ANCESTOR_SEARCH_DEPTH; }
|
|
2209
2256
|
if (!element || depth <= 0)
|
|
2210
2257
|
return '';
|
|
2211
2258
|
var value = element.getAttribute(attr);
|
|
@@ -2214,7 +2261,12 @@ function getAttributeFromAncestors(element, attr, depth) {
|
|
|
2214
2261
|
return getAttributeFromAncestors(element.parentElement, attr, depth - 1);
|
|
2215
2262
|
}
|
|
2216
2263
|
function extractActionName(el) {
|
|
2217
|
-
|
|
2264
|
+
if (!el || el.tagName === BODY_NODE_NAME)
|
|
2265
|
+
return '';
|
|
2266
|
+
var value = el.getAttribute(CX_ACTION_NAME_ATTRIBUTE);
|
|
2267
|
+
if (value)
|
|
2268
|
+
return value;
|
|
2269
|
+
return extractActionName(el.parentElement);
|
|
2218
2270
|
}
|
|
2219
2271
|
function extractAriaLabel(el) {
|
|
2220
2272
|
return getAttributeFromAncestors(el, ARIA_LABEL_ATTRIBUTE);
|
|
@@ -2223,28 +2275,64 @@ function extractTestId(el) {
|
|
|
2223
2275
|
return (el === null || el === void 0 ? void 0 : el.getAttribute(DATA_TEST_ATTRIBUTE)) || '';
|
|
2224
2276
|
}
|
|
2225
2277
|
function extractResolvedName(_a) {
|
|
2226
|
-
var element = _a.element,
|
|
2278
|
+
var element = _a.element, config = _a.config, actionName = _a.actionName, ariaLabel = _a.ariaLabel;
|
|
2227
2279
|
if (!element)
|
|
2228
2280
|
return '';
|
|
2229
|
-
|
|
2230
|
-
|
|
2231
|
-
|
|
2232
|
-
|
|
2233
|
-
|
|
2281
|
+
var resolveName = actionName ||
|
|
2282
|
+
maskedTextIfMasked(element, config) ||
|
|
2283
|
+
resolveFallbackName(element, ariaLabel, ANCESTOR_SEARCH_DEPTH);
|
|
2284
|
+
return normalizeInteractionText(resolveName);
|
|
2285
|
+
}
|
|
2286
|
+
function maskedTextIfMasked(element, config) {
|
|
2287
|
+
return isElementMasked(element, config) ? MASKED_TEXT : '';
|
|
2288
|
+
}
|
|
2289
|
+
function resolveFallbackName(element, ariaLabel, depth) {
|
|
2290
|
+
var _a;
|
|
2291
|
+
if (!element || element.nodeName === BODY_NODE_NAME)
|
|
2292
|
+
return '';
|
|
2293
|
+
var resolvedName = getLabelText(element) ||
|
|
2294
|
+
ariaLabel ||
|
|
2295
|
+
getPlaceholder(element) ||
|
|
2296
|
+
getInnerText(element);
|
|
2297
|
+
if (resolvedName)
|
|
2298
|
+
return resolvedName;
|
|
2299
|
+
if ((_a = element.matches) === null || _a === void 0 ? void 0 : _a.call(element, CLICKABLE_SELECTOR))
|
|
2300
|
+
return '';
|
|
2301
|
+
var parent = element.parentElement;
|
|
2302
|
+
if (depth <= 0 || !parent || parent.nodeName === BODY_NODE_NAME)
|
|
2303
|
+
return '';
|
|
2304
|
+
return resolveFallbackName(parent, ariaLabel, depth - 1);
|
|
2305
|
+
}
|
|
2306
|
+
function getLabelText(element) {
|
|
2307
|
+
var _a;
|
|
2308
|
+
if (!(element instanceof HTMLInputElement ||
|
|
2309
|
+
element instanceof HTMLTextAreaElement ||
|
|
2310
|
+
element instanceof HTMLSelectElement)) {
|
|
2311
|
+
return '';
|
|
2312
|
+
}
|
|
2313
|
+
var label = (_a = element.labels) === null || _a === void 0 ? void 0 : _a[0];
|
|
2314
|
+
return label ? getTextualContent(label) : '';
|
|
2234
2315
|
}
|
|
2235
2316
|
function getPlaceholder(element) {
|
|
2236
|
-
if (element instanceof HTMLInputElement ||
|
|
2317
|
+
if (element instanceof HTMLInputElement ||
|
|
2318
|
+
element instanceof HTMLTextAreaElement) {
|
|
2237
2319
|
return element.placeholder || '';
|
|
2238
2320
|
}
|
|
2239
2321
|
return '';
|
|
2240
2322
|
}
|
|
2241
|
-
function getInnerText(
|
|
2242
|
-
if (!
|
|
2323
|
+
function getInnerText(element) {
|
|
2324
|
+
if (!element)
|
|
2243
2325
|
return '';
|
|
2244
|
-
return
|
|
2245
|
-
?
|
|
2326
|
+
return element instanceof HTMLElement
|
|
2327
|
+
? normalizeInteractionText(element.innerText || '')
|
|
2246
2328
|
: '';
|
|
2247
2329
|
}
|
|
2330
|
+
function normalizeInteractionText(text) {
|
|
2331
|
+
return text
|
|
2332
|
+
.slice(0, MAX_INTERACTION_ELEMENT_SIZE)
|
|
2333
|
+
.replace(/\s+/g, ' ')
|
|
2334
|
+
.trim();
|
|
2335
|
+
}
|
|
2248
2336
|
function extractMaskedOrTextContent(clickableElement, config) {
|
|
2249
2337
|
if (!clickableElement)
|
|
2250
2338
|
return '';
|
|
@@ -2252,7 +2340,7 @@ function extractMaskedOrTextContent(clickableElement, config) {
|
|
|
2252
2340
|
}
|
|
2253
2341
|
function getMaskedOrTextualContent(element, config) {
|
|
2254
2342
|
if (shouldMaskElement(element, config.maskInputTypes, config.maskClass) ||
|
|
2255
|
-
isParentMasked(element, config.maskClass,
|
|
2343
|
+
isParentMasked(element, config.maskClass, ANCESTOR_SEARCH_DEPTH)) {
|
|
2256
2344
|
return MASKED_TEXT;
|
|
2257
2345
|
}
|
|
2258
2346
|
var maskedChild = findMaskedChildren(element, config);
|
|
@@ -2262,14 +2350,22 @@ function getMaskedOrTextualContent(element, config) {
|
|
|
2262
2350
|
return getTextualContent(element);
|
|
2263
2351
|
}
|
|
2264
2352
|
function getTextualContent(element) {
|
|
2265
|
-
|
|
2266
|
-
|
|
2353
|
+
var _a;
|
|
2354
|
+
if (element instanceof HTMLInputElement ||
|
|
2355
|
+
element instanceof HTMLTextAreaElement) {
|
|
2356
|
+
return normalizeInteractionText(element.value || '');
|
|
2357
|
+
}
|
|
2358
|
+
if (element instanceof HTMLSelectElement) {
|
|
2359
|
+
var selectedIndex = element.selectedIndex, options = element.options;
|
|
2360
|
+
return normalizeInteractionText(((_a = options[selectedIndex]) === null || _a === void 0 ? void 0 : _a.text) || '');
|
|
2267
2361
|
}
|
|
2268
|
-
return 'innerText' in element
|
|
2362
|
+
return 'innerText' in element
|
|
2363
|
+
? normalizeInteractionText(element.innerText)
|
|
2364
|
+
: '';
|
|
2269
2365
|
}
|
|
2270
2366
|
function isElementMasked(element, config) {
|
|
2271
2367
|
return (shouldMaskElement(element, config.maskInputTypes, config.maskClass) ||
|
|
2272
|
-
isParentMasked(element, config.maskClass,
|
|
2368
|
+
isParentMasked(element, config.maskClass, ANCESTOR_SEARCH_DEPTH));
|
|
2273
2369
|
}
|
|
2274
2370
|
function shouldMaskElement(element, maskInputTypes, maskClass) {
|
|
2275
2371
|
if (!element)
|
|
@@ -2302,7 +2398,7 @@ function isMaskedByClass(className, maskClass) {
|
|
|
2302
2398
|
return className.includes(maskClass);
|
|
2303
2399
|
}
|
|
2304
2400
|
function isParentMasked(element, maskClass, maxDepth) {
|
|
2305
|
-
if (maxDepth === void 0) { maxDepth =
|
|
2401
|
+
if (maxDepth === void 0) { maxDepth = ANCESTOR_SEARCH_DEPTH; }
|
|
2306
2402
|
if (!element || maxDepth <= 0) {
|
|
2307
2403
|
return false;
|
|
2308
2404
|
}
|
|
@@ -2325,16 +2421,23 @@ function findSemanticClickable(element, maxDepth) {
|
|
|
2325
2421
|
return element;
|
|
2326
2422
|
return findSemanticClickable(element.parentElement, maxDepth - 1);
|
|
2327
2423
|
}
|
|
2328
|
-
function
|
|
2329
|
-
var _a;
|
|
2424
|
+
function findAffordanceClickable(element) {
|
|
2425
|
+
var _a, _b;
|
|
2330
2426
|
if (!element)
|
|
2331
2427
|
return null;
|
|
2332
|
-
|
|
2428
|
+
var cursor = (_a = getComputedStyle(element)) === null || _a === void 0 ? void 0 : _a.cursor;
|
|
2429
|
+
var isPointer = cursor === POINTER_CURSOR;
|
|
2430
|
+
var isText = cursor === TEXT_CURSOR;
|
|
2431
|
+
var isContentEditable = element instanceof HTMLElement && element.isContentEditable;
|
|
2432
|
+
var active = CxGlobal.document.activeElement;
|
|
2433
|
+
var isFocused = (_b = active === null || active === void 0 ? void 0 : active.matches(CLICKABLE_SELECTOR)) !== null && _b !== void 0 ? _b : false;
|
|
2434
|
+
var isInteractive = isPointer || isContentEditable || isFocused || isText;
|
|
2435
|
+
return isInteractive ? element : null;
|
|
2333
2436
|
}
|
|
2334
2437
|
function findClickableElement(element, maxDepth) {
|
|
2335
2438
|
var _a;
|
|
2336
|
-
if (maxDepth === void 0) { maxDepth =
|
|
2337
|
-
return ((_a = findSemanticClickable(element, maxDepth)) !== null && _a !== void 0 ? _a :
|
|
2439
|
+
if (maxDepth === void 0) { maxDepth = ANCESTOR_SEARCH_DEPTH; }
|
|
2440
|
+
return ((_a = findSemanticClickable(element, maxDepth)) !== null && _a !== void 0 ? _a : findAffordanceClickable(element));
|
|
2338
2441
|
}
|
|
2339
2442
|
|
|
2340
2443
|
var RAGE_CLICK_THRESHOLD = 3;
|
|
@@ -2377,12 +2480,6 @@ var RageClickTracker = (function () {
|
|
|
2377
2480
|
}());
|
|
2378
2481
|
|
|
2379
2482
|
var SHADOW_DOM_MARKER = '::shadow ';
|
|
2380
|
-
var STABLE_ATTRIBUTES = [
|
|
2381
|
-
CX_ACTION_NAME_ATTRIBUTE,
|
|
2382
|
-
DATA_TEST_ATTRIBUTE,
|
|
2383
|
-
DATA_TESTID_ATTRIBUTE,
|
|
2384
|
-
DATA_TEST_ID_ATTRIBUTE,
|
|
2385
|
-
];
|
|
2386
2483
|
var ESCAPE_FREE_CLASS_NAME = /^[a-zA-Z_-][a-zA-Z0-9_-]*$/;
|
|
2387
2484
|
var GENERATED_VALUE_PATTERNS = [
|
|
2388
2485
|
/^\d/,
|
|
@@ -2429,7 +2526,11 @@ function getSubtreeSelector(target, root) {
|
|
|
2429
2526
|
function getUniqueSegment(element, root, childSelector) {
|
|
2430
2527
|
var e_1, _a;
|
|
2431
2528
|
try {
|
|
2432
|
-
for (var _b = __values$1([
|
|
2529
|
+
for (var _b = __values$1([
|
|
2530
|
+
getActionNameSegment(element),
|
|
2531
|
+
getIdSegment(element),
|
|
2532
|
+
getTestIdSegment(element),
|
|
2533
|
+
]), _c = _b.next(); !_c.done; _c = _b.next()) {
|
|
2433
2534
|
var segment = _c.value;
|
|
2434
2535
|
if (segment && isUnique(root, joinWithChild(segment, childSelector))) {
|
|
2435
2536
|
return segment;
|
|
@@ -2448,7 +2549,7 @@ function getUniqueSegment(element, root, childSelector) {
|
|
|
2448
2549
|
function getLevelSegment(element, childSelector) {
|
|
2449
2550
|
var e_2, _a;
|
|
2450
2551
|
var candidates = [
|
|
2451
|
-
|
|
2552
|
+
getActionNameSegment(element),
|
|
2452
2553
|
getStableClassSegment(element),
|
|
2453
2554
|
element.tagName,
|
|
2454
2555
|
];
|
|
@@ -2469,29 +2570,23 @@ function getLevelSegment(element, childSelector) {
|
|
|
2469
2570
|
}
|
|
2470
2571
|
return "".concat(element.tagName, ":nth-of-type(").concat(nthOfTypeIndex(element), ")");
|
|
2471
2572
|
}
|
|
2472
|
-
function
|
|
2473
|
-
var
|
|
2474
|
-
|
|
2475
|
-
|
|
2476
|
-
|
|
2477
|
-
var value = element.getAttribute(attribute);
|
|
2478
|
-
if (value) {
|
|
2479
|
-
return "".concat(element.tagName, "[").concat(attribute, "=\"").concat(CSS.escape(value), "\"]");
|
|
2480
|
-
}
|
|
2481
|
-
}
|
|
2482
|
-
}
|
|
2483
|
-
catch (e_3_1) { e_3 = { error: e_3_1 }; }
|
|
2484
|
-
finally {
|
|
2485
|
-
try {
|
|
2486
|
-
if (STABLE_ATTRIBUTES_1_1 && !STABLE_ATTRIBUTES_1_1.done && (_a = STABLE_ATTRIBUTES_1.return)) _a.call(STABLE_ATTRIBUTES_1);
|
|
2487
|
-
}
|
|
2488
|
-
finally { if (e_3) throw e_3.error; }
|
|
2489
|
-
}
|
|
2490
|
-
return undefined;
|
|
2573
|
+
function getActionNameSegment(element) {
|
|
2574
|
+
var value = element.getAttribute(CX_ACTION_NAME_ATTRIBUTE);
|
|
2575
|
+
return value
|
|
2576
|
+
? "".concat(element.tagName, "[").concat(CX_ACTION_NAME_ATTRIBUTE, "=\"").concat(CSS.escape(value), "\"]")
|
|
2577
|
+
: undefined;
|
|
2491
2578
|
}
|
|
2579
|
+
var CONTAINS_DIGIT = /\d/;
|
|
2492
2580
|
function getIdSegment(element) {
|
|
2493
|
-
|
|
2494
|
-
|
|
2581
|
+
var id = element.id;
|
|
2582
|
+
return id && !isUnstableValue(id) && !CONTAINS_DIGIT.test(id)
|
|
2583
|
+
? "#".concat(CSS.escape(id))
|
|
2584
|
+
: undefined;
|
|
2585
|
+
}
|
|
2586
|
+
function getTestIdSegment(element) {
|
|
2587
|
+
var value = element.getAttribute(DATA_TEST_ATTRIBUTE);
|
|
2588
|
+
return value && !isUnstableValue(value) && !CONTAINS_DIGIT.test(value)
|
|
2589
|
+
? "".concat(element.tagName, "[").concat(DATA_TEST_ATTRIBUTE, "=\"").concat(CSS.escape(value), "\"]")
|
|
2495
2590
|
: undefined;
|
|
2496
2591
|
}
|
|
2497
2592
|
function getStableClassSegment(element) {
|
|
@@ -2510,7 +2605,7 @@ function isUnique(root, selector) {
|
|
|
2510
2605
|
return root.querySelectorAll(selector).length === 1;
|
|
2511
2606
|
}
|
|
2512
2607
|
function isUniqueAmongSiblings(element, segment, childSelector) {
|
|
2513
|
-
var
|
|
2608
|
+
var e_3, _a;
|
|
2514
2609
|
var _b, _c;
|
|
2515
2610
|
var siblings = (_c = (_b = element.parentElement) === null || _b === void 0 ? void 0 : _b.children) !== null && _c !== void 0 ? _c : [];
|
|
2516
2611
|
try {
|
|
@@ -2525,12 +2620,12 @@ function isUniqueAmongSiblings(element, segment, childSelector) {
|
|
|
2525
2620
|
}
|
|
2526
2621
|
}
|
|
2527
2622
|
}
|
|
2528
|
-
catch (
|
|
2623
|
+
catch (e_3_1) { e_3 = { error: e_3_1 }; }
|
|
2529
2624
|
finally {
|
|
2530
2625
|
try {
|
|
2531
2626
|
if (siblings_1_1 && !siblings_1_1.done && (_a = siblings_1.return)) _a.call(siblings_1);
|
|
2532
2627
|
}
|
|
2533
|
-
finally { if (
|
|
2628
|
+
finally { if (e_3) throw e_3.error; }
|
|
2534
2629
|
}
|
|
2535
2630
|
return true;
|
|
2536
2631
|
}
|
|
@@ -2588,13 +2683,12 @@ var CoralogixUserInteractionInstrumentation = (function (_super) {
|
|
|
2588
2683
|
}
|
|
2589
2684
|
if (eventTarget instanceof Element) {
|
|
2590
2685
|
var clickableElement = findClickableElement(eventTarget);
|
|
2591
|
-
var elementText = extractMaskedOrTextContent(
|
|
2686
|
+
var elementText = extractMaskedOrTextContent(eventTarget, config);
|
|
2592
2687
|
var cxActionName = extractActionName(eventTarget);
|
|
2593
2688
|
var ariaLabel = extractAriaLabel(eventTarget);
|
|
2594
2689
|
var testId = extractTestId(eventTarget);
|
|
2595
2690
|
var resolvedName = extractResolvedName({
|
|
2596
2691
|
element: eventTarget,
|
|
2597
|
-
clickableElement: clickableElement,
|
|
2598
2692
|
config: config,
|
|
2599
2693
|
actionName: cxActionName,
|
|
2600
2694
|
ariaLabel: ariaLabel,
|
|
@@ -2615,15 +2709,9 @@ var CoralogixUserInteractionInstrumentation = (function (_super) {
|
|
|
2615
2709
|
[CoralogixAttributes.ELEMENT_ID, id],
|
|
2616
2710
|
[CoralogixAttributes.ELEMENT_CLASSES, getClassName(eventTarget)],
|
|
2617
2711
|
[CoralogixAttributes.TARGET_ELEMENT_TYPE, type],
|
|
2618
|
-
[
|
|
2619
|
-
CoralogixAttributes.ELEMENT_INNER_TEXT,
|
|
2620
|
-
elementText === null || elementText === void 0 ? void 0 : elementText.slice(0, MAX_INTERACTION_ELEMENT_SIZE),
|
|
2621
|
-
],
|
|
2712
|
+
[CoralogixAttributes.ELEMENT_INNER_TEXT, elementText],
|
|
2622
2713
|
[CoralogixAttributes.TARGET_ELEMENT, nodeName],
|
|
2623
|
-
[
|
|
2624
|
-
CoralogixAttributes.RESOLVED_NAME,
|
|
2625
|
-
resolvedName === null || resolvedName === void 0 ? void 0 : resolvedName.slice(0, MAX_INTERACTION_ELEMENT_SIZE),
|
|
2626
|
-
],
|
|
2714
|
+
[CoralogixAttributes.RESOLVED_NAME, resolvedName],
|
|
2627
2715
|
[CoralogixAttributes.CX_ACTION_NAME, cxActionName],
|
|
2628
2716
|
[CoralogixAttributes.ARIA_LABEL, ariaLabel],
|
|
2629
2717
|
[CoralogixAttributes.TEST_ID, testId],
|
|
@@ -3073,7 +3161,9 @@ var idPatterns = [
|
|
|
3073
3161
|
var PATH_ID_PLACEHOLDER = '/{id}';
|
|
3074
3162
|
var NUMERIC_PATH_SEGMENT_REGEX = /\/(?![vV]\d{1,2}\/)([^/\d?]*\d+[^/?]*)/g;
|
|
3075
3163
|
function replaceNumericPathSegments(url) {
|
|
3076
|
-
var replacePath = function (s) {
|
|
3164
|
+
var replacePath = function (s) {
|
|
3165
|
+
return s.replace(NUMERIC_PATH_SEGMENT_REGEX, PATH_ID_PLACEHOLDER);
|
|
3166
|
+
};
|
|
3077
3167
|
try {
|
|
3078
3168
|
var origin_1 = new URL(url).origin;
|
|
3079
3169
|
if (origin_1 === 'null' || !url.startsWith(origin_1))
|
|
@@ -3224,6 +3314,7 @@ var CoralogixDomainsApiUrlMap = {
|
|
|
3224
3314
|
AP1: 'https://ingress.ap1.rum-ingress-coralogix.com',
|
|
3225
3315
|
AP2: 'https://ingress.ap2.rum-ingress-coralogix.com',
|
|
3226
3316
|
AP3: 'https://ingress.ap3.rum-ingress-coralogix.com',
|
|
3317
|
+
PROOFPOINT: 'https://ingress.proofpoint.rum-ingress-coralogix.com',
|
|
3227
3318
|
STAGING: 'https://ingress.staging.rum-ingress-coralogix.com',
|
|
3228
3319
|
};
|
|
3229
3320
|
var PROXY_CX_FORWARD_PARAMETER = 'cxforward';
|
|
@@ -3338,7 +3429,8 @@ var getCachedUrlParts = function (cacheKey, url) {
|
|
|
3338
3429
|
}
|
|
3339
3430
|
catch (_c) {
|
|
3340
3431
|
}
|
|
3341
|
-
var
|
|
3432
|
+
var baseParts = getUrlParts(url);
|
|
3433
|
+
var parts = baseParts && __assign(__assign({}, baseParts), { path: getUrlFragments(url) });
|
|
3342
3434
|
try {
|
|
3343
3435
|
(_b = CxGlobal.sessionStorage) === null || _b === void 0 ? void 0 : _b.setItem(cacheKey, JSON.stringify({ url: url, parts: parts }));
|
|
3344
3436
|
}
|
|
@@ -3505,6 +3597,7 @@ function resolvePageContext(url) {
|
|
|
3505
3597
|
domain: urlParts === null || urlParts === void 0 ? void 0 : urlParts.domain,
|
|
3506
3598
|
host: urlParts === null || urlParts === void 0 ? void 0 : urlParts.host,
|
|
3507
3599
|
referrer: document.referrer,
|
|
3600
|
+
referrer_path: referrerParts === null || referrerParts === void 0 ? void 0 : referrerParts.path,
|
|
3508
3601
|
referrer_schema: referrerParts === null || referrerParts === void 0 ? void 0 : referrerParts.schema,
|
|
3509
3602
|
referrer_subdomain: referrerParts === null || referrerParts === void 0 ? void 0 : referrerParts.subdomain,
|
|
3510
3603
|
referrer_domain: referrerParts === null || referrerParts === void 0 ? void 0 : referrerParts.domain,
|
|
@@ -5039,7 +5132,7 @@ function resolveUrlBlueprinters(urlBlueprinters) {
|
|
|
5039
5132
|
return resolvedUrlBlueprinters;
|
|
5040
5133
|
}
|
|
5041
5134
|
|
|
5042
|
-
var SDK_VERSION = '3.
|
|
5135
|
+
var SDK_VERSION = '3.21.0';
|
|
5043
5136
|
|
|
5044
5137
|
function shouldDropEvent(cxRumEvent, options) {
|
|
5045
5138
|
if (isDocumentErrorWithoutMessage(cxRumEvent)) {
|
|
@@ -5098,12 +5191,13 @@ function validateBeforeSendResult(beforeSendResult) {
|
|
|
5098
5191
|
return beforeSendResult;
|
|
5099
5192
|
}
|
|
5100
5193
|
function cxRumEventToEditable(cxRumEvent) {
|
|
5101
|
-
var _a = cxRumEvent.session_context, user_id = _a.user_id, user_name = _a.user_name, user_email = _a.user_email, account_id = _a.account_id, user_metadata = _a.user_metadata; cxRumEvent.browser_sdk; cxRumEvent.timestamp; cxRumEvent.isNavigationEvent; cxRumEvent.isSnapshotEvent; cxRumEvent.view_number; var rest = __rest(cxRumEvent, ["session_context", "browser_sdk", "timestamp", "isNavigationEvent", "isSnapshotEvent", "view_number"]);
|
|
5194
|
+
var _a = cxRumEvent.session_context, user_id = _a.user_id, user_name = _a.user_name, user_email = _a.user_email, account_id = _a.account_id, account_name = _a.account_name, user_metadata = _a.user_metadata; cxRumEvent.browser_sdk; cxRumEvent.timestamp; cxRumEvent.isNavigationEvent; cxRumEvent.isSnapshotEvent; cxRumEvent.view_number; var rest = __rest(cxRumEvent, ["session_context", "browser_sdk", "timestamp", "isNavigationEvent", "isSnapshotEvent", "view_number"]);
|
|
5102
5195
|
return __assign(__assign({}, rest), { session_context: {
|
|
5103
5196
|
user_id: user_id,
|
|
5104
5197
|
user_email: user_email,
|
|
5105
5198
|
user_name: user_name,
|
|
5106
5199
|
account_id: account_id,
|
|
5200
|
+
account_name: account_name,
|
|
5107
5201
|
user_metadata: user_metadata,
|
|
5108
5202
|
} });
|
|
5109
5203
|
}
|
|
@@ -5156,7 +5250,7 @@ function flattenToAttributes(obj, prefix) {
|
|
|
5156
5250
|
function buildRumContextAttributes(cxRumEvent, resolvedLabels) {
|
|
5157
5251
|
var session_context = cxRumEvent.session_context, page_context = cxRumEvent.page_context, event_context = cxRumEvent.event_context, error_context = cxRumEvent.error_context, network_request_context = cxRumEvent.network_request_context;
|
|
5158
5252
|
var prefixedLabels = flattenToAttributes(resolvedLabels, 'cx_rum.labels.');
|
|
5159
|
-
return buildCxRumSpanAttributes(__assign(__assign({ 'cx_rum.browser_sdk.version': cxRumEvent.browser_sdk.version, 'cx_rum.platform': cxRumEvent.platform, 'cx_rum.environment': cxRumEvent.environment, 'cx_rum.version_metadata.app_name': cxRumEvent.version_metadata.app_name, 'cx_rum.version_metadata.app_version': cxRumEvent.version_metadata.app_version }, prefixedLabels), { 'cx_rum.session_context.session_id': session_context === null || session_context === void 0 ? void 0 : session_context.session_id, 'cx_rum.session_context.session_creation_date': session_context === null || session_context === void 0 ? void 0 : session_context.session_creation_date, 'cx_rum.session_context.hasRecording': session_context === null || session_context === void 0 ? void 0 : session_context.hasRecording, 'cx_rum.session_context.os': session_context === null || session_context === void 0 ? void 0 : session_context.os, 'cx_rum.session_context.osVersion': session_context === null || session_context === void 0 ? void 0 : session_context.osVersion, 'cx_rum.session_context.browser': session_context === null || session_context === void 0 ? void 0 : session_context.browser, 'cx_rum.session_context.browserVersion': session_context === null || session_context === void 0 ? void 0 : session_context.browserVersion, 'cx_rum.session_context.device': session_context === null || session_context === void 0 ? void 0 : session_context.device, 'cx_rum.session_context.user_agent': session_context === null || session_context === void 0 ? void 0 : session_context.user_agent, 'cx_rum.session_context.user_email': session_context === null || session_context === void 0 ? void 0 : session_context.user_email, 'cx_rum.session_context.user_id': session_context === null || session_context === void 0 ? void 0 : session_context.user_id, 'cx_rum.session_context.user_name': session_context === null || session_context === void 0 ? void 0 : session_context.user_name, 'cx_rum.session_context.account_id': session_context === null || session_context === void 0 ? void 0 : session_context.account_id, 'cx_rum.page_context.page_fragments': page_context === null || page_context === void 0 ? void 0 : page_context.page_fragments, 'cx_rum.page_context.page_url_blueprint': page_context === null || page_context === void 0 ? void 0 : page_context.page_url_blueprint, 'cx_rum.event_context.type': event_context === null || event_context === void 0 ? void 0 : event_context.type, 'cx_rum.event_context.severity': event_context === null || event_context === void 0 ? void 0 : event_context.severity, 'cx_rum.error_context.error_type': error_context === null || error_context === void 0 ? void 0 : error_context.error_type, 'cx_rum.error_context.error_message': error_context === null || error_context === void 0 ? void 0 : error_context.error_message, 'cx_rum.network_request_context.fragments': network_request_context === null || network_request_context === void 0 ? void 0 : network_request_context.fragments, 'cx_rum.network_request_context.url': network_request_context === null || network_request_context === void 0 ? void 0 : network_request_context.url, 'cx_rum.network_request_context.status_code': network_request_context === null || network_request_context === void 0 ? void 0 : network_request_context.status_code, 'cx_rum.network_request_context.method': network_request_context === null || network_request_context === void 0 ? void 0 : network_request_context.method }));
|
|
5253
|
+
return buildCxRumSpanAttributes(__assign(__assign({ 'cx_rum.browser_sdk.version': cxRumEvent.browser_sdk.version, 'cx_rum.platform': cxRumEvent.platform, 'cx_rum.environment': cxRumEvent.environment, 'cx_rum.version_metadata.app_name': cxRumEvent.version_metadata.app_name, 'cx_rum.version_metadata.app_version': cxRumEvent.version_metadata.app_version }, prefixedLabels), { 'cx_rum.session_context.session_id': session_context === null || session_context === void 0 ? void 0 : session_context.session_id, 'cx_rum.session_context.session_creation_date': session_context === null || session_context === void 0 ? void 0 : session_context.session_creation_date, 'cx_rum.session_context.hasRecording': session_context === null || session_context === void 0 ? void 0 : session_context.hasRecording, 'cx_rum.session_context.os': session_context === null || session_context === void 0 ? void 0 : session_context.os, 'cx_rum.session_context.osVersion': session_context === null || session_context === void 0 ? void 0 : session_context.osVersion, 'cx_rum.session_context.browser': session_context === null || session_context === void 0 ? void 0 : session_context.browser, 'cx_rum.session_context.browserVersion': session_context === null || session_context === void 0 ? void 0 : session_context.browserVersion, 'cx_rum.session_context.device': session_context === null || session_context === void 0 ? void 0 : session_context.device, 'cx_rum.session_context.user_agent': session_context === null || session_context === void 0 ? void 0 : session_context.user_agent, 'cx_rum.session_context.user_email': session_context === null || session_context === void 0 ? void 0 : session_context.user_email, 'cx_rum.session_context.user_id': session_context === null || session_context === void 0 ? void 0 : session_context.user_id, 'cx_rum.session_context.user_name': session_context === null || session_context === void 0 ? void 0 : session_context.user_name, 'cx_rum.session_context.account_id': session_context === null || session_context === void 0 ? void 0 : session_context.account_id, 'cx_rum.session_context.account_name': session_context === null || session_context === void 0 ? void 0 : session_context.account_name, 'cx_rum.page_context.page_fragments': page_context === null || page_context === void 0 ? void 0 : page_context.page_fragments, 'cx_rum.page_context.page_url_blueprint': page_context === null || page_context === void 0 ? void 0 : page_context.page_url_blueprint, 'cx_rum.event_context.type': event_context === null || event_context === void 0 ? void 0 : event_context.type, 'cx_rum.event_context.severity': event_context === null || event_context === void 0 ? void 0 : event_context.severity, 'cx_rum.error_context.error_type': error_context === null || error_context === void 0 ? void 0 : error_context.error_type, 'cx_rum.error_context.error_message': error_context === null || error_context === void 0 ? void 0 : error_context.error_message, 'cx_rum.network_request_context.fragments': network_request_context === null || network_request_context === void 0 ? void 0 : network_request_context.fragments, 'cx_rum.network_request_context.url': network_request_context === null || network_request_context === void 0 ? void 0 : network_request_context.url, 'cx_rum.network_request_context.status_code': network_request_context === null || network_request_context === void 0 ? void 0 : network_request_context.status_code, 'cx_rum.network_request_context.method': network_request_context === null || network_request_context === void 0 ? void 0 : network_request_context.method }));
|
|
5160
5254
|
}
|
|
5161
5255
|
|
|
5162
5256
|
var CoralogixSpanMapProcessor = (function () {
|
|
@@ -5199,9 +5293,9 @@ var CoralogixSpanMapProcessor = (function () {
|
|
|
5199
5293
|
return Promise.resolve(undefined);
|
|
5200
5294
|
};
|
|
5201
5295
|
CoralogixSpanMapProcessor.prototype._mapToCxSpan = function (span, session, prevSession, sessionHasRecording, sessionHasScreenshot, onlySessionWithErrorMode) {
|
|
5202
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
|
|
5203
|
-
var
|
|
5204
|
-
var
|
|
5296
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l;
|
|
5297
|
+
var _m = session || {}, sessionId = _m.sessionId, sessionCreationDate = _m.sessionCreationDate;
|
|
5298
|
+
var _o = prevSession || {}, prevSessionId = _o.sessionId, prevSessionCreationDate = _o.sessionCreationDate, prevSessionHasRecording = _o.hasRecording, prevSessionHasScreenshot = _o.hasScreenshot;
|
|
5205
5299
|
var attributes = span.attributes;
|
|
5206
5300
|
var user_context = JSON.parse(attributes[CoralogixAttributes.USER_CONTEXT]);
|
|
5207
5301
|
var application_context = JSON.parse(attributes[CoralogixAttributes.APPLICATION_CONTEXT]);
|
|
@@ -5232,7 +5326,7 @@ var CoralogixSpanMapProcessor = (function () {
|
|
|
5232
5326
|
text: {
|
|
5233
5327
|
cx_rum: __assign(__assign({ fingerPrint: fingerPrint, platform: 'browser', timestamp: timestamp }, eventTypeContext), { browser_sdk: {
|
|
5234
5328
|
version: SDK_VERSION,
|
|
5235
|
-
}, version_metadata: version_metadata, session_context: __assign(__assign(__assign(__assign({}, user_context), { session_id: sessionId, session_creation_date: sessionCreationDate, prev_session: prevSessionId
|
|
5329
|
+
}, version_metadata: version_metadata, session_context: __assign(__assign(__assign(__assign({}, user_context), { user_id: String((_b = user_context === null || user_context === void 0 ? void 0 : user_context.user_id) !== null && _b !== void 0 ? _b : ''), session_id: sessionId, session_creation_date: sessionCreationDate, prev_session: prevSessionId
|
|
5236
5330
|
? {
|
|
5237
5331
|
session_id: prevSessionId,
|
|
5238
5332
|
session_creation_date: prevSessionCreationDate,
|
|
@@ -5244,13 +5338,13 @@ var CoralogixSpanMapProcessor = (function () {
|
|
|
5244
5338
|
source: attributes[CoralogixAttributes.SOURCE],
|
|
5245
5339
|
severity: severity,
|
|
5246
5340
|
}, labels: labels, environment: attributes[CoralogixAttributes.ENVIRONMENT] || '', view_number: getSessionManager().viewNumber, layout_context: {
|
|
5247
|
-
viewport_width: (
|
|
5248
|
-
viewport_height: (
|
|
5249
|
-
view_width: (
|
|
5250
|
-
view_height: (
|
|
5251
|
-
device_pixel_ratio: (
|
|
5252
|
-
scroll_x: (
|
|
5253
|
-
scroll_y: (
|
|
5341
|
+
viewport_width: (_c = window === null || window === void 0 ? void 0 : window.innerWidth) !== null && _c !== void 0 ? _c : 0,
|
|
5342
|
+
viewport_height: (_d = window === null || window === void 0 ? void 0 : window.innerHeight) !== null && _d !== void 0 ? _d : 0,
|
|
5343
|
+
view_width: (_f = (_e = document === null || document === void 0 ? void 0 : document.documentElement) === null || _e === void 0 ? void 0 : _e.scrollWidth) !== null && _f !== void 0 ? _f : 0,
|
|
5344
|
+
view_height: (_h = (_g = document === null || document === void 0 ? void 0 : document.documentElement) === null || _g === void 0 ? void 0 : _g.scrollHeight) !== null && _h !== void 0 ? _h : 0,
|
|
5345
|
+
device_pixel_ratio: (_j = window === null || window === void 0 ? void 0 : window.devicePixelRatio) !== null && _j !== void 0 ? _j : 1,
|
|
5346
|
+
scroll_x: (_k = window === null || window === void 0 ? void 0 : window.scrollX) !== null && _k !== void 0 ? _k : 0,
|
|
5347
|
+
scroll_y: (_l = window === null || window === void 0 ? void 0 : window.scrollY) !== null && _l !== void 0 ? _l : 0,
|
|
5254
5348
|
} }),
|
|
5255
5349
|
},
|
|
5256
5350
|
};
|
|
@@ -5668,9 +5762,9 @@ var CoralogixRum = {
|
|
|
5668
5762
|
init: function (options) {
|
|
5669
5763
|
var _a, _b;
|
|
5670
5764
|
var _this = this;
|
|
5671
|
-
var _c;
|
|
5765
|
+
var _c, _d;
|
|
5672
5766
|
try {
|
|
5673
|
-
if (isInited) {
|
|
5767
|
+
if (isInited || ((_c = CxGlobal === null || CxGlobal === void 0 ? void 0 : CxGlobal.CoralogixRum) === null || _c === void 0 ? void 0 : _c.isInited)) {
|
|
5674
5768
|
if (options === null || options === void 0 ? void 0 : options.debug) {
|
|
5675
5769
|
console.debug('CoralogixRum already initialized, skipping init');
|
|
5676
5770
|
}
|
|
@@ -5786,7 +5880,7 @@ var CoralogixRum = {
|
|
|
5786
5880
|
spanMapProcessor = new CoralogixSpanMapProcessor();
|
|
5787
5881
|
tracerProvider.addSpanProcessor(spanMapProcessor);
|
|
5788
5882
|
new SnapshotManager();
|
|
5789
|
-
if ((
|
|
5883
|
+
if ((_d = resolvedOptions_1.sessionRecordingConfig) === null || _d === void 0 ? void 0 : _d.enable) {
|
|
5790
5884
|
new ClickScreenshotManager();
|
|
5791
5885
|
}
|
|
5792
5886
|
snapshotProcessor = new CoralogixSnapshotSpanProcessor();
|
|
@@ -5797,10 +5891,10 @@ var CoralogixRum = {
|
|
|
5797
5891
|
tracerProvider: tracerProvider,
|
|
5798
5892
|
instrumentations: instrumentations,
|
|
5799
5893
|
});
|
|
5800
|
-
var
|
|
5894
|
+
var _e = __read$1(partition(resolvedOptions_1.labelProviders || [], function (_a) {
|
|
5801
5895
|
var urlType = _a.urlType;
|
|
5802
5896
|
return urlType === UrlType.PAGE || !urlType;
|
|
5803
|
-
}), 2), pageUrlLabelProviders =
|
|
5897
|
+
}), 2), pageUrlLabelProviders = _e[0], networkUrlLabelProviders = _e[1];
|
|
5804
5898
|
saveInternalRumData(PAGE_URL_LABEL_PROVIDERS_KEY, pageUrlLabelProviders);
|
|
5805
5899
|
saveInternalRumData(NETWORK_URL_LABEL_PROVIDERS_KEY, networkUrlLabelProviders);
|
|
5806
5900
|
isInited = true;
|
package/package.json
CHANGED
package/sessionRecorder.esm.js
CHANGED
|
@@ -20,6 +20,7 @@ var EventType;
|
|
|
20
20
|
EventType[EventType["Meta"] = 4] = "Meta";
|
|
21
21
|
EventType[EventType["Custom"] = 5] = "Custom";
|
|
22
22
|
EventType[EventType["Plugin"] = 6] = "Plugin";
|
|
23
|
+
EventType[EventType["Asset"] = 7] = "Asset";
|
|
23
24
|
})(EventType || (EventType = {}));
|
|
24
25
|
var IncrementalSource;
|
|
25
26
|
(function (IncrementalSource) {
|
|
@@ -131,13 +132,14 @@ function getUntaintedPrototype(key) {
|
|
|
131
132
|
}
|
|
132
133
|
try {
|
|
133
134
|
var iframeEl = document.createElement('iframe');
|
|
135
|
+
iframeEl.style.display = 'none';
|
|
134
136
|
document.body.appendChild(iframeEl);
|
|
135
137
|
var win = iframeEl.contentWindow;
|
|
136
138
|
if (!win)
|
|
137
139
|
return defaultObj.prototype;
|
|
138
140
|
var untaintedObject = win[key]
|
|
139
141
|
.prototype;
|
|
140
|
-
|
|
142
|
+
iframeEl.remove();
|
|
141
143
|
if (!untaintedObject)
|
|
142
144
|
return defaultPrototype;
|
|
143
145
|
return (untaintedBasePrototype[key] = untaintedObject);
|
|
@@ -214,6 +216,10 @@ function querySelectorAll(n, selectors) {
|
|
|
214
216
|
function mutationObserverCtor() {
|
|
215
217
|
return getUntaintedPrototype('MutationObserver').constructor;
|
|
216
218
|
}
|
|
219
|
+
var nowTimestamp = Date.now;
|
|
220
|
+
if (!(/[1-9][0-9]{12}/.test(Date.now().toString()))) {
|
|
221
|
+
nowTimestamp = function () { return new Date().getTime(); };
|
|
222
|
+
}
|
|
217
223
|
function patch(source, name, replacement) {
|
|
218
224
|
try {
|
|
219
225
|
if (!(name in source)) {
|
|
@@ -254,7 +260,8 @@ var dom = {
|
|
|
254
260
|
shadowRoot: shadowRoot,
|
|
255
261
|
querySelector: querySelector,
|
|
256
262
|
querySelectorAll: querySelectorAll,
|
|
257
|
-
|
|
263
|
+
nowTimestamp: nowTimestamp,
|
|
264
|
+
mutationObserverCtor: mutationObserverCtor,
|
|
258
265
|
patch: patch,
|
|
259
266
|
};
|
|
260
267
|
|
|
@@ -504,8 +511,10 @@ function absolutifyURLs(cssText, href) {
|
|
|
504
511
|
if (filePath[0] === '/') {
|
|
505
512
|
return "url(".concat(maybeQuote).concat(extractOrigin(href) + filePath).concat(maybeQuote, ")");
|
|
506
513
|
}
|
|
507
|
-
var
|
|
508
|
-
var
|
|
514
|
+
var filePathNoHash = filePath.split('#')[0];
|
|
515
|
+
var maybeHash = filePath.substring(filePathNoHash.length);
|
|
516
|
+
var stack = href.split('#')[0].split('/');
|
|
517
|
+
var parts = filePathNoHash.split('/');
|
|
509
518
|
stack.pop();
|
|
510
519
|
try {
|
|
511
520
|
for (var parts_1 = __values(parts), parts_1_1 = parts_1.next(); !parts_1_1.done; parts_1_1 = parts_1.next()) {
|
|
@@ -528,7 +537,7 @@ function absolutifyURLs(cssText, href) {
|
|
|
528
537
|
}
|
|
529
538
|
finally { if (e_1) throw e_1.error; }
|
|
530
539
|
}
|
|
531
|
-
return "url(".concat(maybeQuote).concat(stack.join('/')).concat(maybeQuote, ")");
|
|
540
|
+
return "url(".concat(maybeQuote).concat(stack.join('/')).concat(maybeHash).concat(maybeQuote, ")");
|
|
532
541
|
});
|
|
533
542
|
}
|
|
534
543
|
function normalizeCssString(cssText, _testNoPxNorm) {
|
|
@@ -1660,10 +1669,6 @@ function hookSetter(target, key, d, isRevoked, win) {
|
|
|
1660
1669
|
});
|
|
1661
1670
|
return function () { return hookSetter(target, key, original || {}, true); };
|
|
1662
1671
|
}
|
|
1663
|
-
var nowTimestamp = Date.now;
|
|
1664
|
-
if (!(/[1-9][0-9]{12}/.test(Date.now().toString()))) {
|
|
1665
|
-
nowTimestamp = function () { return new Date().getTime(); };
|
|
1666
|
-
}
|
|
1667
1672
|
function getWindowScroll(win) {
|
|
1668
1673
|
var _a, _b, _c, _d;
|
|
1669
1674
|
var doc = win.document;
|
|
@@ -2896,6 +2901,7 @@ function getNestedCSSRulePositions(rule) {
|
|
|
2896
2901
|
var rules = Array.from(childRule.parentRule.cssRules);
|
|
2897
2902
|
var index = rules.indexOf(childRule);
|
|
2898
2903
|
pos.unshift(index);
|
|
2904
|
+
return recurse(childRule.parentRule, pos);
|
|
2899
2905
|
}
|
|
2900
2906
|
else if (childRule.parentStyleSheet) {
|
|
2901
2907
|
var rules = Array.from(childRule.parentStyleSheet.cssRules);
|
|
@@ -4188,7 +4194,9 @@ function patchGLPrototype(prototype, type, cb, blockClass, blockSelector, win) {
|
|
|
4188
4194
|
}
|
|
4189
4195
|
function initCanvasWebGLMutationObserver(cb, win, blockClass, blockSelector) {
|
|
4190
4196
|
var handlers = [];
|
|
4191
|
-
|
|
4197
|
+
if (typeof win.WebGLRenderingContext !== 'undefined') {
|
|
4198
|
+
handlers.push.apply(handlers, __spreadArray([], __read(patchGLPrototype(win.WebGLRenderingContext.prototype, CanvasContext.WebGL, cb, blockClass, blockSelector, win)), false));
|
|
4199
|
+
}
|
|
4192
4200
|
if (typeof win.WebGL2RenderingContext !== 'undefined') {
|
|
4193
4201
|
handlers.push.apply(handlers, __spreadArray([], __read(patchGLPrototype(win.WebGL2RenderingContext.prototype, CanvasContext.WebGL2, cb, blockClass, blockSelector, win)), false));
|
|
4194
4202
|
}
|
package/src/constants.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { addedNodeMutation, blockClass, DeprecatedMirror, DocumentDimension, hookResetter, IMirror, IWindow, listenerHandler, textMutation, throttleOptions } from '../rrweb-types';
|
|
2
2
|
import type { Mirror, SlimDOMOptions } from '../rrweb-snapshot';
|
|
3
|
+
export { nowTimestamp } from '../rrweb-utils';
|
|
3
4
|
interface RRNode {
|
|
4
5
|
nodeName: string;
|
|
5
6
|
nodeType: number;
|
|
@@ -11,8 +12,6 @@ export declare function on(type: string, fn: EventListenerOrEventListenerObject,
|
|
|
11
12
|
export declare let _mirror: DeprecatedMirror;
|
|
12
13
|
export declare function throttle<T>(func: (arg: T) => void, wait: number, options?: throttleOptions): (this: any, ...args: T[]) => void;
|
|
13
14
|
export declare function hookSetter<T>(target: T, key: string | number | symbol, d: PropertyDescriptor, isRevoked?: boolean, win?: Window & typeof globalThis): hookResetter;
|
|
14
|
-
declare let nowTimestamp: () => number;
|
|
15
|
-
export { nowTimestamp };
|
|
16
15
|
export declare function getWindowScroll(win: Window): {
|
|
17
16
|
left: number;
|
|
18
17
|
top: number;
|
|
@@ -43,7 +42,7 @@ export declare function getBaseDimension(node: Node, rootIframe: Node): Document
|
|
|
43
42
|
export declare function hasShadowRoot<T extends Node | RRNode>(n: T): n is T & {
|
|
44
43
|
shadowRoot: ShadowRoot;
|
|
45
44
|
};
|
|
46
|
-
export declare function getNestedRule(rules: CSSRuleList, position: number[]): CSSGroupingRule;
|
|
45
|
+
export declare function getNestedRule(rules: CSSRuleList, position: number[]): CSSGroupingRule | null;
|
|
47
46
|
export declare function getPositionsAndIndex(nestedIndex: number[]): {
|
|
48
47
|
positions: number[];
|
|
49
48
|
index: number | undefined;
|
|
@@ -5,7 +5,8 @@ export declare enum EventType {
|
|
|
5
5
|
IncrementalSnapshot = 3,
|
|
6
6
|
Meta = 4,
|
|
7
7
|
Custom = 5,
|
|
8
|
-
Plugin = 6
|
|
8
|
+
Plugin = 6,
|
|
9
|
+
Asset = 7
|
|
9
10
|
}
|
|
10
11
|
export type domContentLoadedEvent = {
|
|
11
12
|
type: EventType.DomContentLoaded;
|
|
@@ -51,6 +52,13 @@ export type pluginEvent<T = unknown> = {
|
|
|
51
52
|
payload: T;
|
|
52
53
|
};
|
|
53
54
|
};
|
|
55
|
+
export type assetEvent = {
|
|
56
|
+
type: EventType.Asset;
|
|
57
|
+
data: assetParam;
|
|
58
|
+
};
|
|
59
|
+
export type assetEventWithTime = assetEvent & {
|
|
60
|
+
timestamp: number;
|
|
61
|
+
};
|
|
54
62
|
export declare enum IncrementalSource {
|
|
55
63
|
Mutation = 0,
|
|
56
64
|
MouseMove = 1,
|
|
@@ -115,7 +123,7 @@ export type customElementData = {
|
|
|
115
123
|
source: IncrementalSource.CustomElement;
|
|
116
124
|
} & customElementParam;
|
|
117
125
|
export type incrementalData = mutationData | mousemoveData | mouseInteractionData | scrollData | viewportResizeData | inputData | mediaInteractionData | styleSheetRuleData | canvasMutationData | fontData | selectionData | styleDeclarationData | adoptedStyleSheetData | customElementData;
|
|
118
|
-
export type eventWithoutTime = domContentLoadedEvent | loadedEvent | fullSnapshotEvent | incrementalSnapshotEvent | metaEvent | customEvent | pluginEvent;
|
|
126
|
+
export type eventWithoutTime = domContentLoadedEvent | loadedEvent | fullSnapshotEvent | incrementalSnapshotEvent | metaEvent | customEvent | pluginEvent | assetEvent;
|
|
119
127
|
export type event = eventWithoutTime;
|
|
120
128
|
export type eventWithTime = eventWithoutTime & {
|
|
121
129
|
timestamp: number;
|
|
@@ -258,14 +266,19 @@ export declare enum CanvasContext {
|
|
|
258
266
|
WebGL = 1,
|
|
259
267
|
WebGL2 = 2
|
|
260
268
|
}
|
|
261
|
-
export type
|
|
262
|
-
rr_type: '
|
|
263
|
-
|
|
264
|
-
}
|
|
269
|
+
export type SerializedCssTextArg = {
|
|
270
|
+
rr_type: 'CssText';
|
|
271
|
+
cssTexts: string[];
|
|
272
|
+
};
|
|
273
|
+
export type SerializedBlobArg = {
|
|
265
274
|
rr_type: 'Blob';
|
|
266
275
|
data: Array<CanvasArg>;
|
|
267
276
|
type?: string;
|
|
268
|
-
}
|
|
277
|
+
};
|
|
278
|
+
export type SerializedCanvasArg = {
|
|
279
|
+
rr_type: 'ArrayBuffer';
|
|
280
|
+
base64: string;
|
|
281
|
+
} | SerializedBlobArg | {
|
|
269
282
|
rr_type: string;
|
|
270
283
|
src: string;
|
|
271
284
|
} | {
|
|
@@ -422,6 +435,18 @@ export type customElementParam = {
|
|
|
422
435
|
};
|
|
423
436
|
};
|
|
424
437
|
export type customElementCallback = (c: customElementParam) => void;
|
|
438
|
+
export type assetParam = {
|
|
439
|
+
url: string;
|
|
440
|
+
payload: SerializedCanvasArg | SerializedCssTextArg;
|
|
441
|
+
timestamp?: number;
|
|
442
|
+
} | {
|
|
443
|
+
url: string;
|
|
444
|
+
failed: {
|
|
445
|
+
status?: number;
|
|
446
|
+
message: string;
|
|
447
|
+
};
|
|
448
|
+
};
|
|
449
|
+
export type assetCallback = (d: assetParam, timestamp?: number | true) => void;
|
|
425
450
|
interface INode extends Node {
|
|
426
451
|
__sn: serializedNodeWithId;
|
|
427
452
|
}
|
|
@@ -21,6 +21,8 @@ export declare function shadowRoot(n: Node): ShadowRoot | null;
|
|
|
21
21
|
export declare function querySelector(n: Element, selectors: string): Element | null;
|
|
22
22
|
export declare function querySelectorAll(n: Element, selectors: string): NodeListOf<Element>;
|
|
23
23
|
export declare function mutationObserverCtor(): (typeof MutationObserver)['prototype']['constructor'];
|
|
24
|
+
declare let nowTimestamp: () => number;
|
|
25
|
+
export { nowTimestamp };
|
|
24
26
|
export declare function patch(source: {
|
|
25
27
|
[key: string]: any;
|
|
26
28
|
}, name: string, replacement: (...args: any[]) => any): () => void;
|
|
@@ -37,7 +39,8 @@ declare const _default: {
|
|
|
37
39
|
shadowRoot: typeof shadowRoot;
|
|
38
40
|
querySelector: typeof querySelector;
|
|
39
41
|
querySelectorAll: typeof querySelectorAll;
|
|
40
|
-
|
|
42
|
+
nowTimestamp: () => number;
|
|
43
|
+
mutationObserverCtor: typeof mutationObserverCtor;
|
|
41
44
|
patch: typeof patch;
|
|
42
45
|
};
|
|
43
46
|
export default _default;
|
|
@@ -1,5 +1,3 @@
|
|
|
1
1
|
export declare const CX_ACTION_NAME_ATTRIBUTE = "data-cx-action-name";
|
|
2
2
|
export declare const DATA_TEST_ATTRIBUTE = "data-test";
|
|
3
|
-
export declare const DATA_TESTID_ATTRIBUTE = "data-testid";
|
|
4
|
-
export declare const DATA_TEST_ID_ATTRIBUTE = "data-test-id";
|
|
5
3
|
export declare const RR_IS_PASSWORD_ATTRIBUTE = "data-rr-is-password";
|
|
@@ -2,13 +2,12 @@ import { CoralogixBrowserSdkConfig } from '../../types';
|
|
|
2
2
|
export declare function extractActionName(el: Element | HTMLElement | null): string;
|
|
3
3
|
export declare function extractAriaLabel(el: Element | HTMLElement | null): string;
|
|
4
4
|
export declare function extractTestId(el: Element | HTMLElement | null): string;
|
|
5
|
-
export declare function extractResolvedName({ element,
|
|
5
|
+
export declare function extractResolvedName({ element, config, actionName, ariaLabel, }: {
|
|
6
6
|
element: Element | HTMLElement | null;
|
|
7
|
-
clickableElement: Element | HTMLElement | null;
|
|
8
7
|
config: CoralogixBrowserSdkConfig;
|
|
9
8
|
actionName: string;
|
|
10
9
|
ariaLabel: string;
|
|
11
10
|
}): string;
|
|
12
11
|
export declare function extractMaskedOrTextContent(clickableElement: Element | HTMLElement | null, config: CoralogixBrowserSdkConfig): string;
|
|
13
12
|
export declare function getClassName(element: Element | HTMLElement): string;
|
|
14
|
-
export declare function findClickableElement(element: Element | HTMLElement
|
|
13
|
+
export declare function findClickableElement(element: Element | HTMLElement, maxDepth?: number): Element | HTMLElement | null;
|
|
@@ -19,6 +19,7 @@ export interface CxRumSpanAttributes extends Attributes {
|
|
|
19
19
|
'cx_rum.session_context.user_id'?: string;
|
|
20
20
|
'cx_rum.session_context.user_name'?: string;
|
|
21
21
|
'cx_rum.session_context.account_id'?: string;
|
|
22
|
+
'cx_rum.session_context.account_name'?: string;
|
|
22
23
|
'cx_rum.page_context.page_fragments'?: string;
|
|
23
24
|
'cx_rum.page_context.page_url_blueprint'?: string;
|
|
24
25
|
'cx_rum.event_context.type'?: string;
|
package/src/tools/cx-timers.d.ts
CHANGED
package/src/types.d.ts
CHANGED
|
@@ -65,6 +65,7 @@ export interface UserContextConfig {
|
|
|
65
65
|
user_name: string;
|
|
66
66
|
user_email?: string;
|
|
67
67
|
account_id?: string;
|
|
68
|
+
account_name?: string;
|
|
68
69
|
user_metadata?: {
|
|
69
70
|
[key: string]: any;
|
|
70
71
|
};
|
|
@@ -299,6 +300,7 @@ export interface UserMetadata {
|
|
|
299
300
|
user_name?: string;
|
|
300
301
|
user_email?: string;
|
|
301
302
|
account_id?: string;
|
|
303
|
+
account_name?: string;
|
|
302
304
|
user_metadata?: {
|
|
303
305
|
[key: string]: any;
|
|
304
306
|
};
|
|
@@ -354,6 +356,7 @@ export interface PageContext {
|
|
|
354
356
|
domain?: string;
|
|
355
357
|
host?: string;
|
|
356
358
|
referrer: string;
|
|
359
|
+
referrer_path?: string;
|
|
357
360
|
referrer_schema?: string;
|
|
358
361
|
referrer_subdomain?: string;
|
|
359
362
|
referrer_domain?: string;
|
package/src/utils/all.d.ts
CHANGED
|
@@ -11,6 +11,7 @@ type UrlParts = {
|
|
|
11
11
|
subdomain: string;
|
|
12
12
|
domain: string;
|
|
13
13
|
host: string;
|
|
14
|
+
path?: string;
|
|
14
15
|
};
|
|
15
16
|
export declare const getUrlParts: (url: string) => UrlParts | undefined;
|
|
16
17
|
export declare const getCachedUrlParts: (cacheKey: string, url: string) => UrlParts | undefined;
|
package/src/version.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const SDK_VERSION = "3.
|
|
1
|
+
export declare const SDK_VERSION = "3.21.0";
|