change(tracker): change enum export, remoe attrs from hidden containers
This commit is contained in:
parent
9156ffdf54
commit
73597913ff
3 changed files with 13 additions and 3 deletions
|
|
@ -37,6 +37,8 @@ function isObservable(node: Node): boolean {
|
|||
return !isIgnored(node)
|
||||
}
|
||||
|
||||
const BASE_ATTRS = ['style', 'class']
|
||||
|
||||
/*
|
||||
TODO:
|
||||
- fix unbinding logic + send all removals first (ensure sequence is correct)
|
||||
|
|
@ -291,8 +293,14 @@ export default abstract class Observer {
|
|||
const width = el.clientWidth
|
||||
const height = el.clientHeight
|
||||
el = node.cloneNode() as Element
|
||||
;(el as HTMLElement | SVGElement).style.width = width + 'px'
|
||||
;(el as HTMLElement | SVGElement).style.height = height + 'px'
|
||||
const attrs = el.getAttributeNames()
|
||||
attrs.forEach((attr) => {
|
||||
if (!attr.startsWith('data-openreplay') && !BASE_ATTRS.includes(attr)) {
|
||||
el.removeAttribute(attr)
|
||||
}
|
||||
})
|
||||
;(el as HTMLElement | SVGElement).style.width = `${width}px`
|
||||
;(el as HTMLElement | SVGElement).style.height = `${height}px`
|
||||
}
|
||||
|
||||
this.app.send(CreateElementNode(id, parentID, index, el.tagName, isSVGElement(node)))
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@ import type App from './index.js'
|
|||
import { stars, hasOpenreplayAttribute } from '../utils.js'
|
||||
import { isElementNode } from './guards.js'
|
||||
|
||||
export declare const enum SanitizeLevel {
|
||||
export enum SanitizeLevel {
|
||||
Plain,
|
||||
Obscured,
|
||||
Hidden,
|
||||
|
|
|
|||
|
|
@ -4,6 +4,8 @@ export { default as App } from './app/index.js'
|
|||
import { UserID, UserAnonymousID, RawCustomEvent, CustomIssue } from './app/messages.gen.js'
|
||||
import * as _Messages from './app/messages.gen.js'
|
||||
export const Messages = _Messages
|
||||
import { SanitizeLevel as SanitizeEnum } from './app/sanitizer.js'
|
||||
export const SanitizeLevel = SanitizeEnum
|
||||
|
||||
import Connection from './modules/connection.js'
|
||||
import Console from './modules/console.js'
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue