clarity-js 0.6.37 → 0.6.40
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/build/clarity.js +132 -70
- package/build/clarity.min.js +1 -1
- package/build/clarity.module.js +132 -70
- package/package.json +1 -1
- package/src/core/scrub.ts +33 -10
- package/src/core/version.ts +1 -1
- package/src/index.ts +1 -1
- package/src/interaction/pointer.ts +1 -1
- package/src/layout/dom.ts +18 -14
- package/src/layout/encode.ts +1 -1
- package/src/layout/selector.ts +47 -27
- package/test/core.test.ts +26 -2
- package/test/helper.ts +30 -2
- package/test/html/core.html +1 -1
- package/types/data.d.ts +3 -1
- package/types/index.d.ts +6 -1
- package/types/layout.d.ts +13 -6
package/build/clarity.js
CHANGED
|
@@ -115,7 +115,7 @@ function stop$B() {
|
|
|
115
115
|
startTime = 0;
|
|
116
116
|
}
|
|
117
117
|
|
|
118
|
-
var version$1 = "0.6.
|
|
118
|
+
var version$1 = "0.6.40";
|
|
119
119
|
|
|
120
120
|
// tslint:disable: no-bitwise
|
|
121
121
|
function hash (input) {
|
|
@@ -142,9 +142,9 @@ var buffer = null;
|
|
|
142
142
|
var update$2 = false;
|
|
143
143
|
function start$E() {
|
|
144
144
|
update$2 = false;
|
|
145
|
-
reset$
|
|
145
|
+
reset$p();
|
|
146
146
|
}
|
|
147
|
-
function reset$
|
|
147
|
+
function reset$p() {
|
|
148
148
|
// Baseline state holds the previous values - if it is updated in the current payload,
|
|
149
149
|
// reset the state to current value after sending the previous state
|
|
150
150
|
if (update$2) {
|
|
@@ -212,14 +212,14 @@ function compute$c() {
|
|
|
212
212
|
}
|
|
213
213
|
}
|
|
214
214
|
function stop$A() {
|
|
215
|
-
reset$
|
|
215
|
+
reset$p();
|
|
216
216
|
}
|
|
217
217
|
|
|
218
218
|
var baseline = /*#__PURE__*/Object.freeze({
|
|
219
219
|
__proto__: null,
|
|
220
220
|
get state () { return state$9; },
|
|
221
221
|
start: start$E,
|
|
222
|
-
reset: reset$
|
|
222
|
+
reset: reset$p,
|
|
223
223
|
track: track$7,
|
|
224
224
|
activity: activity,
|
|
225
225
|
visibility: visibility,
|
|
@@ -289,7 +289,7 @@ function max(metric, value) {
|
|
|
289
289
|
function compute$b() {
|
|
290
290
|
encode$1(0 /* Event.Metric */);
|
|
291
291
|
}
|
|
292
|
-
function reset$
|
|
292
|
+
function reset$o() {
|
|
293
293
|
updates$3 = {};
|
|
294
294
|
}
|
|
295
295
|
|
|
@@ -308,7 +308,7 @@ function start$C() {
|
|
|
308
308
|
interval = 60000 /* Setting.PingInterval */;
|
|
309
309
|
last = 0;
|
|
310
310
|
}
|
|
311
|
-
function reset$
|
|
311
|
+
function reset$n() {
|
|
312
312
|
if (timeout$6) {
|
|
313
313
|
clearTimeout(timeout$6);
|
|
314
314
|
}
|
|
@@ -336,7 +336,7 @@ var ping$1 = /*#__PURE__*/Object.freeze({
|
|
|
336
336
|
__proto__: null,
|
|
337
337
|
get data () { return data$h; },
|
|
338
338
|
start: start$C,
|
|
339
|
-
reset: reset$
|
|
339
|
+
reset: reset$n,
|
|
340
340
|
stop: stop$y
|
|
341
341
|
});
|
|
342
342
|
|
|
@@ -367,7 +367,7 @@ function track$6(event, time) {
|
|
|
367
367
|
function compute$a() {
|
|
368
368
|
encode$1(36 /* Event.Summary */);
|
|
369
369
|
}
|
|
370
|
-
function reset$
|
|
370
|
+
function reset$m() {
|
|
371
371
|
data$g = {};
|
|
372
372
|
}
|
|
373
373
|
|
|
@@ -378,7 +378,7 @@ var summary = /*#__PURE__*/Object.freeze({
|
|
|
378
378
|
stop: stop$x,
|
|
379
379
|
track: track$6,
|
|
380
380
|
compute: compute$a,
|
|
381
|
-
reset: reset$
|
|
381
|
+
reset: reset$m
|
|
382
382
|
});
|
|
383
383
|
|
|
384
384
|
var data$f = null;
|
|
@@ -420,7 +420,7 @@ var upgrade$1 = /*#__PURE__*/Object.freeze({
|
|
|
420
420
|
|
|
421
421
|
var data$e = null;
|
|
422
422
|
function start$z() {
|
|
423
|
-
reset$
|
|
423
|
+
reset$l();
|
|
424
424
|
}
|
|
425
425
|
function set(variable, value) {
|
|
426
426
|
var values = typeof value === "string" /* Constant.String */ ? [value] : value;
|
|
@@ -451,11 +451,11 @@ function log$2(variable, value) {
|
|
|
451
451
|
function compute$9() {
|
|
452
452
|
encode$1(34 /* Event.Variable */);
|
|
453
453
|
}
|
|
454
|
-
function reset$
|
|
454
|
+
function reset$l() {
|
|
455
455
|
data$e = {};
|
|
456
456
|
}
|
|
457
457
|
function stop$v() {
|
|
458
|
-
reset$
|
|
458
|
+
reset$l();
|
|
459
459
|
}
|
|
460
460
|
|
|
461
461
|
var variable = /*#__PURE__*/Object.freeze({
|
|
@@ -465,7 +465,7 @@ var variable = /*#__PURE__*/Object.freeze({
|
|
|
465
465
|
set: set,
|
|
466
466
|
identify: identify,
|
|
467
467
|
compute: compute$9,
|
|
468
|
-
reset: reset$
|
|
468
|
+
reset: reset$l,
|
|
469
469
|
stop: stop$v
|
|
470
470
|
});
|
|
471
471
|
|
|
@@ -604,6 +604,11 @@ function compute$8() {
|
|
|
604
604
|
compute$4();
|
|
605
605
|
}
|
|
606
606
|
|
|
607
|
+
var catchallRegex = /\S/gi;
|
|
608
|
+
var unicodeRegex = true;
|
|
609
|
+
var digitRegex = null;
|
|
610
|
+
var letterRegex = null;
|
|
611
|
+
var currencyRegex = null;
|
|
607
612
|
function scrub (value, hint, privacy, mangle) {
|
|
608
613
|
if (mangle === void 0) { mangle = false; }
|
|
609
614
|
if (value) {
|
|
@@ -615,9 +620,9 @@ function scrub (value, hint, privacy, mangle) {
|
|
|
615
620
|
case "*T" /* Layout.Constant.TextTag */:
|
|
616
621
|
case "value":
|
|
617
622
|
case "placeholder":
|
|
618
|
-
|
|
623
|
+
case "click":
|
|
619
624
|
case "input":
|
|
620
|
-
return
|
|
625
|
+
return redact(value);
|
|
621
626
|
}
|
|
622
627
|
return value;
|
|
623
628
|
case 2 /* Privacy.Text */:
|
|
@@ -654,7 +659,7 @@ function mangleText(value) {
|
|
|
654
659
|
return value;
|
|
655
660
|
}
|
|
656
661
|
function mask(value) {
|
|
657
|
-
return value.replace(
|
|
662
|
+
return value.replace(catchallRegex, "\u2022" /* Data.Constant.Mask */);
|
|
658
663
|
}
|
|
659
664
|
function mangleToken(value) {
|
|
660
665
|
var length = ((Math.floor(value.length / 5 /* Data.Setting.WordLength */) + 1) * 5 /* Data.Setting.WordLength */);
|
|
@@ -666,10 +671,23 @@ function mangleToken(value) {
|
|
|
666
671
|
}
|
|
667
672
|
function redact(value) {
|
|
668
673
|
var spaceIndex = -1;
|
|
674
|
+
var gap = 0;
|
|
669
675
|
var hasDigit = false;
|
|
670
676
|
var hasEmail = false;
|
|
671
677
|
var hasWhitespace = false;
|
|
672
678
|
var array = null;
|
|
679
|
+
// Initialize unicode regex, if supported by the browser
|
|
680
|
+
// Reference: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Regular_Expressions/Unicode_Property_Escapes
|
|
681
|
+
if (unicodeRegex && digitRegex === null) {
|
|
682
|
+
try {
|
|
683
|
+
digitRegex = new RegExp("\\p{N}", "gu");
|
|
684
|
+
letterRegex = new RegExp("\\p{L}", "gu");
|
|
685
|
+
currencyRegex = new RegExp("\\p{Sc}", "gu");
|
|
686
|
+
}
|
|
687
|
+
catch (_a) {
|
|
688
|
+
unicodeRegex = false;
|
|
689
|
+
}
|
|
690
|
+
}
|
|
673
691
|
for (var i = 0; i < value.length; i++) {
|
|
674
692
|
var c = value.charCodeAt(i);
|
|
675
693
|
hasDigit = hasDigit || (c >= 48 /* Data.Character.Zero */ && c <= 57 /* Data.Character.Nine */); // Check for digits in the current word
|
|
@@ -682,7 +700,19 @@ function redact(value) {
|
|
|
682
700
|
if (array === null) {
|
|
683
701
|
array = value.split("" /* Data.Constant.Empty */);
|
|
684
702
|
}
|
|
685
|
-
|
|
703
|
+
// Work on a token at a time so we don't have to apply regex to a larger string
|
|
704
|
+
var token = value.substring(spaceIndex + 1, hasWhitespace ? i : i + 1);
|
|
705
|
+
// Check if unicode regex is supported, otherwise fallback to calling mask function on this token
|
|
706
|
+
if (unicodeRegex && currencyRegex !== null) {
|
|
707
|
+
// Do not redact information if the token contains a currency symbol
|
|
708
|
+
token = token.match(currencyRegex) ? token : token.replace(letterRegex, "\u2022" /* Data.Constant.Letter */).replace(digitRegex, "\u2022" /* Data.Constant.Digit */);
|
|
709
|
+
}
|
|
710
|
+
else {
|
|
711
|
+
token = mask(token);
|
|
712
|
+
}
|
|
713
|
+
// Merge token back into array at the right place
|
|
714
|
+
array.splice(spaceIndex + 1 - gap, token.length, token);
|
|
715
|
+
gap += token.length - 1;
|
|
686
716
|
}
|
|
687
717
|
// Reset digit and email flags after every word boundary, except the beginning of string
|
|
688
718
|
if (hasWhitespace) {
|
|
@@ -693,11 +723,6 @@ function redact(value) {
|
|
|
693
723
|
}
|
|
694
724
|
}
|
|
695
725
|
return array ? array.join("" /* Data.Constant.Empty */) : value;
|
|
696
|
-
}
|
|
697
|
-
function mutate(array, start, end) {
|
|
698
|
-
for (var i = start + 1; i < end; i++) {
|
|
699
|
-
array[i] = "\u2022" /* Data.Constant.Mask */;
|
|
700
|
-
}
|
|
701
726
|
}
|
|
702
727
|
|
|
703
728
|
var history$5 = [];
|
|
@@ -718,12 +743,15 @@ function check$4(id, target, input) {
|
|
|
718
743
|
}
|
|
719
744
|
}
|
|
720
745
|
|
|
721
|
-
var
|
|
722
|
-
|
|
723
|
-
|
|
746
|
+
var excludeClassNames = "load,active,fixed,visible,focus,show,collaps,animat" /* Constant.ExcludeClassNames */.split("," /* Constant.Comma */);
|
|
747
|
+
var selectorMap = {};
|
|
748
|
+
function reset$k() {
|
|
749
|
+
selectorMap = {};
|
|
750
|
+
}
|
|
751
|
+
function get$1(input, type) {
|
|
724
752
|
var a = input.attributes;
|
|
725
|
-
var prefix = input.prefix ? input.prefix[
|
|
726
|
-
var suffix =
|
|
753
|
+
var prefix = input.prefix ? input.prefix[type] : null;
|
|
754
|
+
var suffix = type === 0 /* Selector.Alpha */ ? "".concat("~" /* Constant.Tilde */).concat(input.position - 1) : ":nth-of-type(".concat(input.position, ")");
|
|
727
755
|
switch (input.tag) {
|
|
728
756
|
case "STYLE":
|
|
729
757
|
case "TITLE":
|
|
@@ -738,23 +766,33 @@ function selector (input, beta) {
|
|
|
738
766
|
if (prefix === null) {
|
|
739
767
|
return "" /* Constant.Empty */;
|
|
740
768
|
}
|
|
741
|
-
prefix = "".concat(prefix
|
|
769
|
+
prefix = "".concat(prefix).concat(">" /* Constant.Separator */);
|
|
742
770
|
input.tag = input.tag.indexOf("svg:" /* Constant.SvgPrefix */) === 0 ? input.tag.substr("svg:" /* Constant.SvgPrefix */.length) : input.tag;
|
|
743
771
|
var selector = "".concat(prefix).concat(input.tag).concat(suffix);
|
|
744
|
-
var
|
|
745
|
-
|
|
746
|
-
|
|
747
|
-
|
|
748
|
-
|
|
749
|
-
|
|
750
|
-
|
|
751
|
-
|
|
752
|
-
|
|
753
|
-
|
|
754
|
-
|
|
755
|
-
|
|
756
|
-
|
|
772
|
+
var id = "id" /* Constant.Id */ in a && a["id" /* Constant.Id */].length > 0 ? a["id" /* Constant.Id */] : null;
|
|
773
|
+
var classes = input.tag !== "BODY" /* Constant.BodyTag */ && "class" /* Constant.Class */ in a && a["class" /* Constant.Class */].length > 0 ? a["class" /* Constant.Class */].trim().split(/\s+/).filter(function (c) { return filter(c); }).join("." /* Constant.Period */) : null;
|
|
774
|
+
if (classes && classes.length > 0) {
|
|
775
|
+
if (type === 0 /* Selector.Alpha */) {
|
|
776
|
+
// In Alpha mode, update selector to use class names, with relative positioning within the parent id container.
|
|
777
|
+
// If the node has valid class name(s) then drop relative positioning within the parent path to keep things simple.
|
|
778
|
+
var key = "".concat(getDomPath(prefix)).concat(input.tag).concat("." /* Constant.Dot */).concat(classes);
|
|
779
|
+
if (!(key in selectorMap)) {
|
|
780
|
+
selectorMap[key] = [];
|
|
781
|
+
}
|
|
782
|
+
if (selectorMap[key].indexOf(input.id) < 0) {
|
|
783
|
+
selectorMap[key].push(input.id);
|
|
784
|
+
}
|
|
785
|
+
selector = "".concat(key).concat("~" /* Constant.Tilde */).concat(selectorMap[key].indexOf(input.id));
|
|
786
|
+
}
|
|
787
|
+
else {
|
|
788
|
+
// In Beta mode, we continue to look at query selectors in context of the full page
|
|
789
|
+
selector = "".concat(prefix).concat(input.tag, ".").concat(classes).concat(suffix);
|
|
790
|
+
}
|
|
757
791
|
}
|
|
792
|
+
// Update selector to use "id" field when available. There are two exceptions:
|
|
793
|
+
// (1) if "id" appears to be an auto generated string token, e.g. guid or a random id containing digits
|
|
794
|
+
// (2) if "id" appears inside a shadow DOM, in which case we continue to prefix up to shadow DOM to prevent conflicts
|
|
795
|
+
selector = id && filter(id) ? "".concat(getDomPrefix(prefix)).concat("#" /* Constant.Hash */).concat(id) : selector;
|
|
758
796
|
return selector;
|
|
759
797
|
}
|
|
760
798
|
}
|
|
@@ -763,22 +801,42 @@ function getDomPrefix(prefix) {
|
|
|
763
801
|
var iframeDomStart = prefix.lastIndexOf("".concat("iframe:" /* Constant.IFramePrefix */).concat("HTML" /* Constant.HTML */));
|
|
764
802
|
var domStart = Math.max(shadowDomStart, iframeDomStart);
|
|
765
803
|
if (domStart < 0) {
|
|
766
|
-
return ""
|
|
804
|
+
return "" /* Constant.Empty */;
|
|
805
|
+
}
|
|
806
|
+
return prefix.substring(0, prefix.indexOf(">" /* Constant.Separator */, domStart) + 1);
|
|
807
|
+
}
|
|
808
|
+
function getDomPath(input) {
|
|
809
|
+
var parts = input.split(">" /* Constant.Separator */);
|
|
810
|
+
for (var i = 0; i < parts.length; i++) {
|
|
811
|
+
var tIndex = parts[i].indexOf("~" /* Constant.Tilde */);
|
|
812
|
+
var dIndex = parts[i].indexOf("." /* Constant.Dot */);
|
|
813
|
+
parts[i] = parts[i].substring(0, dIndex > 0 ? dIndex : (tIndex > 0 ? tIndex : parts[i].length));
|
|
767
814
|
}
|
|
768
|
-
|
|
769
|
-
return prefix.substr(0, domEnd);
|
|
815
|
+
return parts.join(">" /* Constant.Separator */);
|
|
770
816
|
}
|
|
771
|
-
// Check if the given input string has digits or
|
|
772
|
-
function
|
|
817
|
+
// Check if the given input string has digits or excluded class names
|
|
818
|
+
function filter(value) {
|
|
819
|
+
if (!value) {
|
|
820
|
+
return false;
|
|
821
|
+
} // Do not process empty strings
|
|
822
|
+
if (excludeClassNames.some(function (x) { return value.toLowerCase().indexOf(x) >= 0; })) {
|
|
823
|
+
return false;
|
|
824
|
+
}
|
|
773
825
|
for (var i = 0; i < value.length; i++) {
|
|
774
826
|
var c = value.charCodeAt(i);
|
|
775
827
|
if (c >= 48 /* Character.Zero */ && c <= 57 /* Character.Nine */) {
|
|
776
|
-
return
|
|
828
|
+
return false;
|
|
777
829
|
}
|
|
778
830
|
}
|
|
779
|
-
return
|
|
831
|
+
return true;
|
|
780
832
|
}
|
|
781
833
|
|
|
834
|
+
var selector = /*#__PURE__*/Object.freeze({
|
|
835
|
+
__proto__: null,
|
|
836
|
+
reset: reset$k,
|
|
837
|
+
get: get$1
|
|
838
|
+
});
|
|
839
|
+
|
|
782
840
|
// Track the start time to be able to compute duration at the end of the task
|
|
783
841
|
var idleTimeout = 5000;
|
|
784
842
|
var tracker = {};
|
|
@@ -1098,7 +1156,7 @@ function encode$4 (type, timer, ts) {
|
|
|
1098
1156
|
}
|
|
1099
1157
|
tokens.push(suspend ? "*M" /* Constant.SuspendMutationTag */ : data[key]);
|
|
1100
1158
|
if (box && box.length === 2) {
|
|
1101
|
-
tokens.push("".concat("#" /* Constant.
|
|
1159
|
+
tokens.push("".concat("#" /* Constant.Hash */).concat(str$1(box[0]), ".").concat(str$1(box[1])));
|
|
1102
1160
|
}
|
|
1103
1161
|
break;
|
|
1104
1162
|
case "attributes":
|
|
@@ -1389,7 +1447,7 @@ function observe$8(root) {
|
|
|
1389
1447
|
bind(root, "mousedown", mouse.bind(this, 13 /* Event.MouseDown */, root), true);
|
|
1390
1448
|
bind(root, "mouseup", mouse.bind(this, 14 /* Event.MouseUp */, root), true);
|
|
1391
1449
|
bind(root, "mousemove", mouse.bind(this, 12 /* Event.MouseMove */, root), true);
|
|
1392
|
-
bind(root, "
|
|
1450
|
+
bind(root, "wheel", mouse.bind(this, 15 /* Event.MouseWheel */, root), true);
|
|
1393
1451
|
bind(root, "dblclick", mouse.bind(this, 16 /* Event.DoubleClick */, root), true);
|
|
1394
1452
|
bind(root, "touchstart", touch.bind(this, 17 /* Event.TouchStart */, root), true);
|
|
1395
1453
|
bind(root, "touchend", touch.bind(this, 18 /* Event.TouchEnd */, root), true);
|
|
@@ -2323,6 +2381,7 @@ var override = [];
|
|
|
2323
2381
|
var unmask = [];
|
|
2324
2382
|
var updatedFragments = {};
|
|
2325
2383
|
var maskText = [];
|
|
2384
|
+
var maskInput = [];
|
|
2326
2385
|
var maskDisable = [];
|
|
2327
2386
|
// The WeakMap object is a collection of key/value pairs in which the keys are weakly referenced
|
|
2328
2387
|
var idMap = null; // Maps node => id.
|
|
@@ -2344,12 +2403,14 @@ function reset$7() {
|
|
|
2344
2403
|
hashMap = {};
|
|
2345
2404
|
override = [];
|
|
2346
2405
|
unmask = [];
|
|
2347
|
-
maskText = "password,
|
|
2406
|
+
maskText = "address,password,contact" /* Mask.Text */.split("," /* Constant.Comma */);
|
|
2407
|
+
maskInput = "password,secret,pass,social,ssn,name,code,dob,cell,mob,contact,hidden,account,cvv,ccv,email,tel,phone,address,addr,card,zip" /* Mask.Input */.split("," /* Constant.Comma */);
|
|
2348
2408
|
maskDisable = "radio,checkbox,range,button,reset,submit" /* Mask.Disable */.split("," /* Constant.Comma */);
|
|
2349
2409
|
idMap = new WeakMap();
|
|
2350
2410
|
iframeMap = new WeakMap();
|
|
2351
2411
|
privacyMap = new WeakMap();
|
|
2352
2412
|
fraudMap = new WeakMap();
|
|
2413
|
+
reset$k();
|
|
2353
2414
|
}
|
|
2354
2415
|
// We parse new root nodes for any regions or masked nodes in the beginning (document) and
|
|
2355
2416
|
// later whenever there are new additions or modifications to DOM (mutations)
|
|
@@ -2526,36 +2587,36 @@ function privacy(node, value, parent) {
|
|
|
2526
2587
|
metadata.privacy = 2 /* Privacy.Text */;
|
|
2527
2588
|
break;
|
|
2528
2589
|
case tag === "*T" /* Constant.TextTag */:
|
|
2529
|
-
// If it's a text node belonging to a STYLE or TITLE tag or one of
|
|
2590
|
+
// If it's a text node belonging to a STYLE or TITLE tag or one of scrub exceptions, then capture content
|
|
2530
2591
|
var pTag = parent && parent.data ? parent.data.tag : "" /* Constant.Empty */;
|
|
2531
|
-
var pSelector_1 = parent && parent.selector ? parent.selector[
|
|
2532
|
-
|
|
2592
|
+
var pSelector_1 = parent && parent.selector ? parent.selector[1 /* Selector.Default */] : "" /* Constant.Empty */;
|
|
2593
|
+
var tags = ["STYLE" /* Constant.StyleTag */, "TITLE" /* Constant.TitleTag */, "svg:style" /* Constant.SvgStyle */];
|
|
2594
|
+
metadata.privacy = tags.includes(pTag) || override.some(function (x) { return pSelector_1.indexOf(x) >= 0; }) ? 0 /* Privacy.None */ : current;
|
|
2533
2595
|
break;
|
|
2534
2596
|
case "type" /* Constant.Type */ in attributes:
|
|
2535
2597
|
// If this node has an explicit type assigned to it, go through masking rules to determine right privacy setting
|
|
2536
|
-
metadata.privacy = inspect(attributes["type" /* Constant.Type */], metadata);
|
|
2598
|
+
metadata.privacy = inspect(attributes["type" /* Constant.Type */], maskInput, metadata);
|
|
2537
2599
|
break;
|
|
2538
2600
|
case tag === "INPUT" /* Constant.InputTag */ && current === 0 /* Privacy.None */:
|
|
2539
2601
|
// If even default privacy setting is to not mask, we still scan through input fields for any sensitive information
|
|
2540
2602
|
var field_1 = "" /* Constant.Empty */;
|
|
2541
2603
|
Object.keys(attributes).forEach(function (x) { return field_1 += attributes[x].toLowerCase(); });
|
|
2542
|
-
metadata.privacy = inspect(field_1, metadata);
|
|
2604
|
+
metadata.privacy = inspect(field_1, maskInput, metadata);
|
|
2543
2605
|
break;
|
|
2544
2606
|
case current === 1 /* Privacy.Sensitive */ && tag === "INPUT" /* Constant.InputTag */:
|
|
2607
|
+
// Look through class names to aggressively mask content
|
|
2608
|
+
metadata.privacy = inspect(attributes["class" /* Constant.Class */], maskText, metadata);
|
|
2545
2609
|
// If it's a button or an input option, make an exception to disable masking
|
|
2546
2610
|
metadata.privacy = maskDisable.indexOf(attributes["type" /* Constant.Type */]) >= 0 ? 0 /* Privacy.None */ : current;
|
|
2547
2611
|
break;
|
|
2548
2612
|
case current === 1 /* Privacy.Sensitive */:
|
|
2549
2613
|
// In a mode where we mask sensitive information by default, look through class names to aggressively mask content
|
|
2550
|
-
metadata.privacy = inspect(attributes["class" /* Constant.Class */], metadata);
|
|
2551
|
-
break;
|
|
2552
|
-
default:
|
|
2553
|
-
metadata.privacy = parent ? parent.metadata.privacy : metadata.privacy;
|
|
2614
|
+
metadata.privacy = inspect(attributes["class" /* Constant.Class */], maskText, metadata);
|
|
2554
2615
|
break;
|
|
2555
2616
|
}
|
|
2556
2617
|
}
|
|
2557
|
-
function inspect(input, metadata) {
|
|
2558
|
-
if (input &&
|
|
2618
|
+
function inspect(input, lookup, metadata) {
|
|
2619
|
+
if (input && lookup.some(function (x) { return input.indexOf(x) >= 0; })) {
|
|
2559
2620
|
return 2 /* Privacy.Text */;
|
|
2560
2621
|
}
|
|
2561
2622
|
return metadata.privacy;
|
|
@@ -2593,10 +2654,11 @@ function updateSelector(value) {
|
|
|
2593
2654
|
var prefix = parent ? parent.selector : null;
|
|
2594
2655
|
var d = value.data;
|
|
2595
2656
|
var p = position(parent, value);
|
|
2596
|
-
var s = { tag: d.tag, prefix: prefix, position: p, attributes: d.attributes };
|
|
2597
|
-
value.selector = [
|
|
2657
|
+
var s = { id: value.id, tag: d.tag, prefix: prefix, position: p, attributes: d.attributes };
|
|
2658
|
+
value.selector = [get$1(s, 0 /* Selector.Alpha */), get$1(s, 1 /* Selector.Beta */)];
|
|
2598
2659
|
value.hash = value.selector.map(function (x) { return x ? hash(x) : null; });
|
|
2599
2660
|
value.hash.forEach(function (h) { return hashMap[h] = value.id; });
|
|
2661
|
+
// Match fragment configuration against both alpha and beta hash
|
|
2600
2662
|
if (value.hash.some(function (h) { return fragments.indexOf(h) !== -1; })) {
|
|
2601
2663
|
value.fragment = value.id;
|
|
2602
2664
|
}
|
|
@@ -3140,7 +3202,7 @@ function queue(tokens, transmit) {
|
|
|
3140
3202
|
// We enrich the data going out with the existing upload. In these cases, call to upload comes with 'transmit' set to false.
|
|
3141
3203
|
if (transmit && timeout === null) {
|
|
3142
3204
|
if (type !== 25 /* Event.Ping */) {
|
|
3143
|
-
reset$
|
|
3205
|
+
reset$n();
|
|
3144
3206
|
}
|
|
3145
3207
|
timeout = setTimeout(upload, gap);
|
|
3146
3208
|
queuedTime = now;
|
|
@@ -3595,7 +3657,7 @@ function encode$1 (event) {
|
|
|
3595
3657
|
tokens.push(b.data.activityTime);
|
|
3596
3658
|
queue(tokens, false);
|
|
3597
3659
|
}
|
|
3598
|
-
reset$
|
|
3660
|
+
reset$p();
|
|
3599
3661
|
break;
|
|
3600
3662
|
case 25 /* Event.Ping */:
|
|
3601
3663
|
tokens.push(data$h.gap);
|
|
@@ -3628,7 +3690,7 @@ function encode$1 (event) {
|
|
|
3628
3690
|
tokens.push(v);
|
|
3629
3691
|
tokens.push(data$e[v]);
|
|
3630
3692
|
}
|
|
3631
|
-
reset$
|
|
3693
|
+
reset$l();
|
|
3632
3694
|
queue(tokens, false);
|
|
3633
3695
|
}
|
|
3634
3696
|
break;
|
|
@@ -3643,7 +3705,7 @@ function encode$1 (event) {
|
|
|
3643
3705
|
// However, for data over the wire, we round it off to milliseconds precision.
|
|
3644
3706
|
tokens.push(Math.round(updates$3[m]));
|
|
3645
3707
|
}
|
|
3646
|
-
reset$
|
|
3708
|
+
reset$o();
|
|
3647
3709
|
queue(tokens, false);
|
|
3648
3710
|
}
|
|
3649
3711
|
break;
|
|
@@ -3669,7 +3731,7 @@ function encode$1 (event) {
|
|
|
3669
3731
|
tokens.push(key);
|
|
3670
3732
|
tokens.push([].concat.apply([], data$g[e]));
|
|
3671
3733
|
}
|
|
3672
|
-
reset$
|
|
3734
|
+
reset$m();
|
|
3673
3735
|
queue(tokens, false);
|
|
3674
3736
|
}
|
|
3675
3737
|
break;
|