fix(tracker): code review

This commit is contained in:
sylenien 2022-06-22 09:54:26 +02:00
parent 684f1598bc
commit 308ef872f4
2 changed files with 6 additions and 7 deletions

View file

@ -239,8 +239,6 @@ export default abstract class Observer {
return false;
}
this.app.sanitizer.handleNode(id, parentID, node);
}
if (parentID) {
if (this.app.sanitizer.isMaskedContainer(parentID)) {
return false;
}
@ -270,11 +268,9 @@ export default abstract class Observer {
if (this.app.sanitizer.isMaskedContainer(id)) {
const width = el.clientWidth;
const height = el.clientHeight;
console.log(width, height);
el = node.cloneNode() as Element;
(el as HTMLElement | SVGElement).style.width = width + 'px';
(el as HTMLElement | SVGElement).style.height = height + 'px';
console.log(el)
}
this.app.send(new

View file

@ -23,12 +23,15 @@ export default class Sanitizer {
if (
this.masked.has(parentID) ||
(isElementNode(node) &&
(hasOpenreplayAttribute(node, 'masked')))
hasOpenreplayAttribute(node, 'masked'))
) {
this.masked.add(id);
}
if (this.maskedContainers.has(parentID) ||
(isElementNode(node) && hasOpenreplayAttribute(node, 'htmlmasked'))) {
if (
this.maskedContainers.has(parentID) ||
(isElementNode(node) &&
hasOpenreplayAttribute(node, 'htmlmasked'))
) {
this.maskedContainers.add(id);
}
}