Fix inline image issues (#822)
* Fix inline image issues * Fixed img srcset Reverted image crossOrigin change * Tweak rebuilding img srcset
This commit is contained in:
committed by
GitHub
parent
38ff3d8f63
commit
ef0e3317e2
@@ -209,6 +209,13 @@ function buildNode(
|
|||||||
n.attributes.href.endsWith('.js')
|
n.attributes.href.endsWith('.js')
|
||||||
) {
|
) {
|
||||||
// ignore
|
// ignore
|
||||||
|
} else if (
|
||||||
|
tagName === 'img' &&
|
||||||
|
n.attributes.srcset &&
|
||||||
|
n.attributes.rr_dataURL
|
||||||
|
) {
|
||||||
|
// backup original img srcset
|
||||||
|
node.setAttribute('rrweb-original-srcset', n.attributes.srcset as string);
|
||||||
} else {
|
} else {
|
||||||
node.setAttribute(name, value);
|
node.setAttribute(name, value);
|
||||||
}
|
}
|
||||||
@@ -232,11 +239,10 @@ function buildNode(
|
|||||||
// Backup original img src. It may not have been set yet.
|
// Backup original img src. It may not have been set yet.
|
||||||
image.setAttribute(
|
image.setAttribute(
|
||||||
'rrweb-original-src',
|
'rrweb-original-src',
|
||||||
n.attributes['src'] as string,
|
n.attributes.src as string,
|
||||||
);
|
);
|
||||||
image.src = value;
|
image.src = value;
|
||||||
}
|
}
|
||||||
image.removeAttribute(name);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (name === 'rr_width') {
|
if (name === 'rr_width') {
|
||||||
@@ -261,6 +267,7 @@ function buildNode(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (n.isShadowHost) {
|
if (n.isShadowHost) {
|
||||||
/**
|
/**
|
||||||
* Since node is newly rebuilt, it should be a normal element
|
* Since node is newly rebuilt, it should be a normal element
|
||||||
|
|||||||
Reference in New Issue
Block a user