How to use the rrweb-snapshot.transformAttribute function in rrweb-snapshot

To help you get started, we’ve selected a few rrweb-snapshot examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github rrweb-io / rrweb / src / record / observer.ts View on Github external
const value = (target as HTMLElement).getAttribute(attributeName!);
          if (isBlocked(target, blockClass) || value === oldValue) {
            return;
          }
          let item: attributeCursor | undefined = attributes.find(
            a => a.node === target,
          );
          if (!item) {
            item = {
              node: target,
              attributes: {},
            };
            attributes.push(item);
          }
          // overwrite attribute if the mutations was triggered in same time
          item.attributes[attributeName!] = transformAttribute(
            document,
            attributeName!,
            value!,
          );
          break;
        }
        case 'childList': {
          addedNodes.forEach(n => genAdds(n, target));
          removedNodes.forEach(n => {
            const nodeId = mirror.getId(n as INode);
            const parentId = mirror.getId(target as INode);
            if (isBlocked(n, blockClass)) {
              return;
            }
            // removed node has not been serialized yet, just remove it from the Set
            if (addedSet.has(n)) {

rrweb-snapshot

rrweb's component to take a snapshot of DOM, aka DOM serializer

MIT
Latest version published 2 years ago

Package Health Score

82 / 100
Full package analysis