close #140 transform mutated attributes

This commit is contained in:
Yanzhen Yu
2019-11-09 15:49:36 +08:00
parent 4426881f1f
commit 07a46a5997
2 changed files with 7 additions and 3 deletions

View File

@@ -58,7 +58,7 @@
"dependencies": { "dependencies": {
"@types/smoothscroll-polyfill": "^0.3.0", "@types/smoothscroll-polyfill": "^0.3.0",
"mitt": "^1.1.3", "mitt": "^1.1.3",
"rrweb-snapshot": "^0.7.20", "rrweb-snapshot": "^0.7.21",
"smoothscroll-polyfill": "^0.4.3" "smoothscroll-polyfill": "^0.4.3"
} }
} }

View File

@@ -1,4 +1,4 @@
import { INode, serializeNodeWithId } from 'rrweb-snapshot'; import { INode, serializeNodeWithId, transformAttribute } from 'rrweb-snapshot';
import { import {
mirror, mirror,
throttle, throttle,
@@ -130,7 +130,11 @@ function initMutationObserver(
attributes.push(item); attributes.push(item);
} }
// overwrite attribute if the mutations was triggered in same time // overwrite attribute if the mutations was triggered in same time
item.attributes[attributeName!] = value; item.attributes[attributeName!] = transformAttribute(
document,
attributeName!,
value!,
);
break; break;
} }
case 'childList': { case 'childList': {