@appsurify-testmap/rrweb 2.0.0-alpha.21 → 2.0.0-alpha.22
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/rrweb.cjs +5 -3
- package/dist/rrweb.cjs.map +1 -1
- package/dist/rrweb.js +5 -3
- package/dist/rrweb.js.map +1 -1
- package/dist/rrweb.umd.cjs +5 -3
- package/dist/rrweb.umd.cjs.map +2 -2
- package/dist/rrweb.umd.min.cjs +1 -1
- package/dist/rrweb.umd.min.cjs.map +2 -2
- package/package.json +6 -6
package/dist/rrweb.umd.cjs
CHANGED
|
@@ -209,16 +209,18 @@ function getXPath(n2) {
|
|
|
209
209
|
if (n2 === document.body) {
|
|
210
210
|
return "/html/body";
|
|
211
211
|
}
|
|
212
|
+
if (!n2.tagName) {
|
|
213
|
+
return "";
|
|
214
|
+
}
|
|
212
215
|
const parentNode2 = index$1.parentNode(n2);
|
|
213
216
|
if (!parentNode2 || !(parentNode2 instanceof Element)) {
|
|
214
217
|
return "";
|
|
215
218
|
}
|
|
216
219
|
const siblings = Array.from(parentNode2.children).filter(
|
|
217
|
-
(node2) => node2.tagName === n2.tagName
|
|
220
|
+
(node2) => node2.tagName && node2.tagName === n2.tagName
|
|
218
221
|
);
|
|
219
222
|
const index$1$1 = siblings.length > 1 ? `[${siblings.indexOf(n2) + 1}]` : "";
|
|
220
|
-
|
|
221
|
-
return path;
|
|
223
|
+
return getXPath(parentNode2) + "/" + n2.tagName.toLowerCase() + index$1$1;
|
|
222
224
|
}
|
|
223
225
|
function isElement(n2) {
|
|
224
226
|
return n2.nodeType === n2.ELEMENT_NODE;
|