@openreplay/tracker
Advanced tools
Comparing version 3.4.5 to 3.4.6
import Message from '../messages/message'; | ||
import Nodes from './nodes'; | ||
import Observer from './observer'; | ||
import Ticker from './ticker'; | ||
@@ -32,3 +33,3 @@ import type { Options as ObserverOptions } from './observer'; | ||
private readonly messages; | ||
private readonly observer; | ||
readonly observer: Observer; | ||
private readonly startCallbacks; | ||
@@ -35,0 +36,0 @@ private readonly stopCallbacks; |
@@ -20,3 +20,3 @@ "use strict"; | ||
this.isActive = false; | ||
this.version = '3.4.5'; | ||
this.version = '3.4.6'; | ||
this.projectKey = projectKey; | ||
@@ -23,0 +23,0 @@ this.options = Object.assign({ |
@@ -32,2 +32,4 @@ import App from './index'; | ||
private sendNodeAttribute; | ||
getInnerTextSecure(el: HTMLElement): string; | ||
private checkObscure; | ||
private sendNodeData; | ||
@@ -34,0 +36,0 @@ private bindNode; |
@@ -172,2 +172,21 @@ "use strict"; | ||
} | ||
getInnerTextSecure(el) { | ||
const id = this.app.nodes.getID(el); | ||
if (!id) { | ||
return ''; | ||
} | ||
return this.checkObscure(id, el.innerText); | ||
} | ||
checkObscure(id, data) { | ||
if (this.textMasked.has(id)) { | ||
return data.replace(/[^\f\n\r\t\v\u00a0\u1680\u2000-\u200a\u2028\u2029\u202f\u205f\u3000\ufeff]/g, '█'); | ||
} | ||
if (this.options.obscureTextNumbers) { | ||
data = data.replace(/\d/g, '0'); | ||
} | ||
if (this.options.obscureTextEmails) { | ||
data = data.replace(/([^\s]+)@([^\s]+)\.([^\s]+)/g, (...f) => utils_1.stars(f[1]) + '@' + utils_1.stars(f[2]) + '.' + utils_1.stars(f[3])); | ||
} | ||
return data; | ||
} | ||
sendNodeData(id, parentElement, data) { | ||
@@ -178,13 +197,3 @@ if (this.isInstance(parentElement, HTMLStyleElement) || this.isInstance(parentElement, SVGStyleElement)) { | ||
} | ||
if (this.textMasked.has(id)) { | ||
data = data.replace(/[^\f\n\r\t\v\u00a0\u1680\u2000-\u200a\u2028\u2029\u202f\u205f\u3000\ufeff]/g, '█'); | ||
} | ||
else { | ||
if (this.options.obscureTextNumbers) { | ||
data = data.replace(/\d/g, '0'); | ||
} | ||
if (this.options.obscureTextEmails) { | ||
data = data.replace(/([^\s]+)@([^\s]+)\.([^\s]+)/g, (...f) => utils_1.stars(f[1]) + '@' + utils_1.stars(f[2]) + '.' + utils_1.stars(f[3])); | ||
} | ||
} | ||
data = this.checkObscure(id, data); | ||
this.app.send(new messages_1.SetNodeData(id, data)); | ||
@@ -191,0 +200,0 @@ } |
@@ -115,3 +115,3 @@ "use strict"; | ||
req.send(JSON.stringify({ | ||
trackerVersion: '3.4.5', | ||
trackerVersion: '3.4.6', | ||
projectKey: options.projectKey, | ||
@@ -118,0 +118,0 @@ doNotTrack, |
@@ -5,3 +5,2 @@ export interface Options { | ||
beaconSize?: number; | ||
__debug_log?: boolean; | ||
} | ||
@@ -8,0 +7,0 @@ declare type Settings = { |
@@ -69,21 +69,2 @@ "use strict"; | ||
} | ||
function getTargetLabel(target) { | ||
const dl = utils_1.getLabelAttribute(target); | ||
if (dl !== null) { | ||
return dl; | ||
} | ||
const tag = target.tagName.toUpperCase(); | ||
if (tag === 'INPUT') { | ||
return input_1.getInputLabel(target); | ||
} | ||
if (tag === 'BUTTON' || | ||
tag === 'A' || | ||
tag === 'LI' || | ||
target.onclick != null || | ||
target.getAttribute('role') === 'button') { | ||
const label = target.innerText || ''; | ||
return utils_1.normSpaces(label).slice(0, 100); | ||
} | ||
return ''; | ||
} | ||
function default_1(app) { | ||
@@ -94,2 +75,21 @@ // const options: Options = Object.assign( | ||
// ); | ||
function getTargetLabel(target) { | ||
const dl = utils_1.getLabelAttribute(target); | ||
if (dl !== null) { | ||
return dl; | ||
} | ||
const tag = target.tagName.toUpperCase(); | ||
if (tag === 'INPUT') { | ||
return input_1.getInputLabel(target); | ||
} | ||
if (tag === 'BUTTON' || | ||
tag === 'A' || | ||
tag === 'LI' || | ||
target.onclick != null || | ||
target.getAttribute('role') === 'button') { | ||
const label = app.observer.getInnerTextSecure(target); | ||
return utils_1.normSpaces(label).slice(0, 100); | ||
} | ||
return ''; | ||
} | ||
let mousePositionX = -1; | ||
@@ -96,0 +96,0 @@ let mousePositionY = -1; |
import Message from '../messages/message'; | ||
import Nodes from './nodes'; | ||
import Observer from './observer'; | ||
import Ticker from './ticker'; | ||
@@ -32,3 +33,3 @@ import type { Options as ObserverOptions } from './observer'; | ||
private readonly messages; | ||
private readonly observer; | ||
readonly observer: Observer; | ||
private readonly startCallbacks; | ||
@@ -35,0 +36,0 @@ private readonly stopCallbacks; |
@@ -17,3 +17,3 @@ import { timestamp, log, warn } from '../utils'; | ||
this.isActive = false; | ||
this.version = '3.4.5'; | ||
this.version = '3.4.6'; | ||
this.projectKey = projectKey; | ||
@@ -20,0 +20,0 @@ this.options = Object.assign({ |
@@ -32,2 +32,4 @@ import App from './index'; | ||
private sendNodeAttribute; | ||
getInnerTextSecure(el: HTMLElement): string; | ||
private checkObscure; | ||
private sendNodeData; | ||
@@ -34,0 +36,0 @@ private bindNode; |
@@ -170,2 +170,21 @@ import { stars, hasOpenreplayAttribute } from '../utils'; | ||
} | ||
getInnerTextSecure(el) { | ||
const id = this.app.nodes.getID(el); | ||
if (!id) { | ||
return ''; | ||
} | ||
return this.checkObscure(id, el.innerText); | ||
} | ||
checkObscure(id, data) { | ||
if (this.textMasked.has(id)) { | ||
return data.replace(/[^\f\n\r\t\v\u00a0\u1680\u2000-\u200a\u2028\u2029\u202f\u205f\u3000\ufeff]/g, '█'); | ||
} | ||
if (this.options.obscureTextNumbers) { | ||
data = data.replace(/\d/g, '0'); | ||
} | ||
if (this.options.obscureTextEmails) { | ||
data = data.replace(/([^\s]+)@([^\s]+)\.([^\s]+)/g, (...f) => stars(f[1]) + '@' + stars(f[2]) + '.' + stars(f[3])); | ||
} | ||
return data; | ||
} | ||
sendNodeData(id, parentElement, data) { | ||
@@ -176,13 +195,3 @@ if (this.isInstance(parentElement, HTMLStyleElement) || this.isInstance(parentElement, SVGStyleElement)) { | ||
} | ||
if (this.textMasked.has(id)) { | ||
data = data.replace(/[^\f\n\r\t\v\u00a0\u1680\u2000-\u200a\u2028\u2029\u202f\u205f\u3000\ufeff]/g, '█'); | ||
} | ||
else { | ||
if (this.options.obscureTextNumbers) { | ||
data = data.replace(/\d/g, '0'); | ||
} | ||
if (this.options.obscureTextEmails) { | ||
data = data.replace(/([^\s]+)@([^\s]+)\.([^\s]+)/g, (...f) => stars(f[1]) + '@' + stars(f[2]) + '.' + stars(f[3])); | ||
} | ||
} | ||
data = this.checkObscure(id, data); | ||
this.app.send(new SetNodeData(id, data)); | ||
@@ -189,0 +198,0 @@ } |
@@ -111,3 +111,3 @@ import App, { DEFAULT_INGEST_POINT } from './app'; | ||
req.send(JSON.stringify({ | ||
trackerVersion: '3.4.5', | ||
trackerVersion: '3.4.6', | ||
projectKey: options.projectKey, | ||
@@ -114,0 +114,0 @@ doNotTrack, |
@@ -5,3 +5,2 @@ export interface Options { | ||
beaconSize?: number; | ||
__debug_log?: boolean; | ||
} | ||
@@ -8,0 +7,0 @@ declare type Settings = { |
@@ -67,21 +67,2 @@ import { normSpaces, hasOpenreplayAttribute, getLabelAttribute } from '../utils'; | ||
} | ||
function getTargetLabel(target) { | ||
const dl = getLabelAttribute(target); | ||
if (dl !== null) { | ||
return dl; | ||
} | ||
const tag = target.tagName.toUpperCase(); | ||
if (tag === 'INPUT') { | ||
return getInputLabel(target); | ||
} | ||
if (tag === 'BUTTON' || | ||
tag === 'A' || | ||
tag === 'LI' || | ||
target.onclick != null || | ||
target.getAttribute('role') === 'button') { | ||
const label = target.innerText || ''; | ||
return normSpaces(label).slice(0, 100); | ||
} | ||
return ''; | ||
} | ||
export default function (app) { | ||
@@ -92,2 +73,21 @@ // const options: Options = Object.assign( | ||
// ); | ||
function getTargetLabel(target) { | ||
const dl = getLabelAttribute(target); | ||
if (dl !== null) { | ||
return dl; | ||
} | ||
const tag = target.tagName.toUpperCase(); | ||
if (tag === 'INPUT') { | ||
return getInputLabel(target); | ||
} | ||
if (tag === 'BUTTON' || | ||
tag === 'A' || | ||
tag === 'LI' || | ||
target.onclick != null || | ||
target.getAttribute('role') === 'button') { | ||
const label = app.observer.getInnerTextSecure(target); | ||
return normSpaces(label).slice(0, 100); | ||
} | ||
return ''; | ||
} | ||
let mousePositionX = -1; | ||
@@ -94,0 +94,0 @@ let mousePositionY = -1; |
{ | ||
"name": "@openreplay/tracker", | ||
"description": "The OpenReplay tracker main package", | ||
"version": "3.4.5", | ||
"version": "3.4.6", | ||
"keywords": [ | ||
@@ -6,0 +6,0 @@ "logging", |
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
364059
116
9212