",
"license": "MIT",
@@ -20,12 +20,6 @@
"test": "yarn workspace clarity-js test"
},
"devDependencies": {
- "lerna": "^4.0.0",
- "tar": "^6.1.11",
- "trim-newlines": "^4.0.2"
- },
- "resolutions": {
- "tar": "^6.1.7",
- "trim-newlines": "^4.0.2"
+ "lerna": "^5.3.0"
}
}
diff --git a/packages/clarity-decode/package.json b/packages/clarity-decode/package.json
index c6800a8..1ed7e1d 100644
--- a/packages/clarity-decode/package.json
+++ b/packages/clarity-decode/package.json
@@ -1,6 +1,6 @@
{
"name": "clarity-decode",
- "version": "0.6.36",
+ "version": "0.6.37",
"description": "An analytics library that uses web page interactions to generate aggregated insights",
"author": "Microsoft Corp.",
"license": "MIT",
@@ -26,7 +26,7 @@
"url": "https://github.com/Microsoft/clarity/issues"
},
"dependencies": {
- "clarity-js": "^0.6.36"
+ "clarity-js": "^0.6.37"
},
"devDependencies": {
"@rollup/plugin-commonjs": "^19.0.1",
diff --git a/packages/clarity-devtools/package.json b/packages/clarity-devtools/package.json
index 28c1940..1509b63 100644
--- a/packages/clarity-devtools/package.json
+++ b/packages/clarity-devtools/package.json
@@ -1,6 +1,6 @@
{
"name": "clarity-devtools",
- "version": "0.6.36",
+ "version": "0.6.37",
"private": true,
"description": "Adds Clarity debugging support to browser devtools",
"author": "Microsoft Corp.",
@@ -24,9 +24,9 @@
"url": "https://github.com/Microsoft/clarity/issues"
},
"dependencies": {
- "clarity-decode": "^0.6.36",
- "clarity-js": "^0.6.36",
- "clarity-visualize": "^0.6.36"
+ "clarity-decode": "^0.6.37",
+ "clarity-js": "^0.6.37",
+ "clarity-visualize": "^0.6.37"
},
"devDependencies": {
"@rollup/plugin-node-resolve": "^13.0.2",
diff --git a/packages/clarity-devtools/src/config.ts b/packages/clarity-devtools/src/config.ts
index 1d2117f..48a5153 100644
--- a/packages/clarity-devtools/src/config.ts
+++ b/packages/clarity-devtools/src/config.ts
@@ -20,6 +20,7 @@ export default function(): Core.Config {
[Region.Footer, "footer"],
[Region.Navigation, "nav"]
],
+ fraud: [],
extract: [ExtractSource.Javascript, Extract.Performance, "performance.timing"]
};
}
diff --git a/packages/clarity-devtools/static/manifest.json b/packages/clarity-devtools/static/manifest.json
index 3ae8ffb..d4dcb6b 100644
--- a/packages/clarity-devtools/static/manifest.json
+++ b/packages/clarity-devtools/static/manifest.json
@@ -2,8 +2,8 @@
"manifest_version": 2,
"name": "Microsoft Clarity Developer Tools",
"description": "Clarity helps you understand how users are interacting with your website.",
- "version": "0.6.36",
- "version_name": "0.6.36",
+ "version": "0.6.37",
+ "version_name": "0.6.37",
"minimum_chrome_version": "50",
"devtools_page": "devtools.html",
"icons": {
diff --git a/packages/clarity-js/package.json b/packages/clarity-js/package.json
index d28f62c..4666de7 100644
--- a/packages/clarity-js/package.json
+++ b/packages/clarity-js/package.json
@@ -1,6 +1,6 @@
{
"name": "clarity-js",
- "version": "0.6.36",
+ "version": "0.6.37",
"description": "An analytics library that uses web page interactions to generate aggregated insights",
"author": "Microsoft Corp.",
"license": "MIT",
diff --git a/packages/clarity-js/src/core/version.ts b/packages/clarity-js/src/core/version.ts
index aefc52f..e30841f 100644
--- a/packages/clarity-js/src/core/version.ts
+++ b/packages/clarity-js/src/core/version.ts
@@ -1,2 +1,2 @@
-let version = "0.6.36";
+let version = "0.6.37";
export default version;
diff --git a/packages/clarity-js/src/layout/dom.ts b/packages/clarity-js/src/layout/dom.ts
index 8807711..27699e7 100644
--- a/packages/clarity-js/src/layout/dom.ts
+++ b/packages/clarity-js/src/layout/dom.ts
@@ -97,6 +97,7 @@ export function add(node: Node, parent: Node, data: NodeInfo, source: Source): v
regionId = regionId === null ? parentValue.region : regionId;
fragmentId = parentValue.fragment;
fraudId = fraudId === null ? parentValue.metadata.fraud : fraudId;
+ privacyId = parentValue.metadata.privacy;
}
// If there's an explicit region attribute set on the element, use it to mark a region on the page
diff --git a/packages/clarity-js/test/core.test.ts b/packages/clarity-js/test/core.test.ts
index 5144e11..465f96b 100644
--- a/packages/clarity-js/test/core.test.ts
+++ b/packages/clarity-js/test/core.test.ts
@@ -1,4 +1,4 @@
-import { expect } from 'chai';
+import { assert } from 'chai';
import { Browser, Page } from 'playwright';
import { launch, markup, node, text } from './helper';
import { Data, decode } from "clarity-decode";
@@ -33,15 +33,15 @@ describe('Core Tests', () => {
let email = node(decoded, "attributes.id", "eml");
let password = node(decoded, "attributes.id", "pwd");
let search = node(decoded, "attributes.id", "search");
-
+
// Non-sensitive fields continue to pass through with sensitive bits masked off
- expect(heading, "Thanks for your order •••••••••");
+ assert.equal(heading, "Thanks for your order •••••••••");
// Sensitive fields, including input fields, are randomized and masked
- expect(address, "•••••• ••••• ••••• ••••• ••••• •••••");
- expect(email.attributes.value, "••••• •••• •••• ••••");
- expect(password.attributes.value, "••••• ••••");
- expect(search.attributes.value, "••••• •••• ••••");
+ assert.equal(address, "•••••• ••••• ••••• ••••• ••••• •••••");
+ assert.equal(email.attributes.value, "••••• •••• •••• ••••");
+ assert.equal(password.attributes.value, "••••• ••••");
+ assert.equal(search.attributes.value, "hello •••••");
});
it('should mask all text in strict mode', async () => {
@@ -54,14 +54,14 @@ describe('Core Tests', () => {
let search = node(decoded, "attributes.id", "search");
// All fields are randomized and masked
- expect(heading, "• ••••• ••••• ••••• ••••• •••••");
- expect(address, "•••••• ••••• ••••• ••••• ••••• •••••");
- expect(email.attributes.value, "••••• •••• •••• ••••");
- expect(password.attributes.value, "••••• ••••");
- expect(search.attributes.value, "••••• •••• ••••");
+ assert.equal(heading, "• ••••• ••••• ••••• ••••• •••••");
+ assert.equal(address, "•••••• ••••• ••••• ••••• ••••• •••••");
+ assert.equal(email.attributes.value, "••••• •••• •••• ••••");
+ assert.equal(password.attributes.value, "••••• ••••");
+ assert.equal(search.attributes.value, "••••• •••• ••••");
});
- it('should mask all text in relaxed mode', async () => {
+ it('should unmask all text in relaxed mode', async () => {
let encoded: string[] = await markup(page, "core.html", { unmask: ["body"] });
let decoded = encoded.map(x => decode(x));
let heading = text(decoded, "one");
@@ -71,12 +71,21 @@ describe('Core Tests', () => {
let search = node(decoded, "attributes.id", "search");
// Text flows through unmasked for non-sensitive fields, including input fields
- expect(heading, "Thanks for your order #2AB700GH");
- expect(address, "1 Microsoft Way, Redmond, WA - 98052");
- expect(search.attributes.value, "hello world");
+ assert.equal(heading, "Thanks for your order #2AB700GH");
+ assert.equal(address, "1 Microsoft Way, Redmond, WA - 98052");
+ assert.equal(search.attributes.value, "hello w0rld");
// Sensitive fields are still masked
- expect(email.attributes.value, "••••• •••• •••• ••••");
- expect(password.attributes.value, "••••• ••••");
+ assert.equal(email.attributes.value, "••••• •••• •••• ••••");
+ assert.equal(password.attributes.value, "••••• ••••");
+ });
+
+ it('should respect mask config even in relaxed mode', async () => {
+ let encoded: string[] = await markup(page, "core.html", { mask: ["#mask"], unmask: ["body"] });
+ let decoded = encoded.map(x => decode(x));
+ let subtree = text(decoded, "child");
+
+ // Masked sub-trees continue to stay masked
+ assert.equal(subtree, "••••• •••••");
});
});
diff --git a/packages/clarity-js/test/helper.ts b/packages/clarity-js/test/helper.ts
index 70e1f1e..924432a 100644
--- a/packages/clarity-js/test/helper.ts
+++ b/packages/clarity-js/test/helper.ts
@@ -78,6 +78,10 @@ function config(override: Core.Config): string {
const settings = {
delay: 100,
content: true,
+ fraud: [],
+ regions: [],
+ mask: [],
+ unmask: [],
upload: payload => { window["payloads"].push(payload); window["clarity"]("upgrade", "test"); }
}
@@ -100,6 +104,7 @@ function config(override: Core.Config): string {
case "unmask":
case "regions":
case "cookies":
+ case "fraud":
output += `${JSON.stringify(key)}: ${JSON.stringify(settings[key])},`;
break;
default:
diff --git a/packages/clarity-js/test/html/core.html b/packages/clarity-js/test/html/core.html
index ad66b38..bcf436d 100644
--- a/packages/clarity-js/test/html/core.html
+++ b/packages/clarity-js/test/html/core.html
@@ -8,10 +8,13 @@
Thanks for your order #2AB700GH
1 Microsoft Way, Redmond, WA - 98052
+
+ Hello World
+