Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
fix check
fix typo
  • Loading branch information
mydea committed Feb 27, 2023
commit 028c41c12f72d8d68256d4af1d7cb9c15a4893b9
2 changes: 2 additions & 0 deletions packages/rrweb-snapshot/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import snapshot, {
serializeNodeWithId,
transformAttribute,
ignoreAttribute,
visitSnapshot,
cleanupSnapshot,
needMaskingText,
Expand All @@ -24,6 +25,7 @@ export {
addHoverClass,
createCache,
transformAttribute,
ignoreAttribute,
visitSnapshot,
cleanupSnapshot,
needMaskingText,
Expand Down
4 changes: 2 additions & 2 deletions packages/rrweb-snapshot/src/snapshot.ts
Original file line number Diff line number Diff line change
Expand Up @@ -252,8 +252,8 @@ export function transformAttribute(
}
}

function ignoreAttribute(tagName: string, name: string, _value: unknown) {
return (tagName === 'video' || tagName === 'audio') && name === 'autplay';
export function ignoreAttribute(tagName: string, name: string, _value: unknown): boolean {
return (tagName === 'video' || tagName === 'audio') && name === 'autoplay';
}

export function _isBlockedElement(
Expand Down
3 changes: 2 additions & 1 deletion packages/rrweb/src/record/mutation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import {
serializeNodeWithId,
transformAttribute,
IGNORED_NODE,
ignoreAttribute,
isShadowRoot,
needMaskingText,
maskInputValue,
Expand Down Expand Up @@ -557,7 +558,7 @@ export default class MutationBuffer {
styleObj[pname] = false; // delete
}
}
} else {
} else if(!ignoreAttribute(target.tagName, m.attributeName!, value)) {
// overwrite attribute if the mutations was triggered in same time
item.attributes[m.attributeName!] = transformAttribute(
this.doc,
Expand Down