@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.js
CHANGED
|
@@ -163,16 +163,18 @@ function getXPath(n2) {
|
|
|
163
163
|
if (n2 === document.body) {
|
|
164
164
|
return "/html/body";
|
|
165
165
|
}
|
|
166
|
+
if (!n2.tagName) {
|
|
167
|
+
return "";
|
|
168
|
+
}
|
|
166
169
|
const parentNode2 = index$1.parentNode(n2);
|
|
167
170
|
if (!parentNode2 || !(parentNode2 instanceof Element)) {
|
|
168
171
|
return "";
|
|
169
172
|
}
|
|
170
173
|
const siblings = Array.from(parentNode2.children).filter(
|
|
171
|
-
(node2) => node2.tagName === n2.tagName
|
|
174
|
+
(node2) => node2.tagName && node2.tagName === n2.tagName
|
|
172
175
|
);
|
|
173
176
|
const index$1$1 = siblings.length > 1 ? `[${siblings.indexOf(n2) + 1}]` : "";
|
|
174
|
-
|
|
175
|
-
return path;
|
|
177
|
+
return getXPath(parentNode2) + "/" + n2.tagName.toLowerCase() + index$1$1;
|
|
176
178
|
}
|
|
177
179
|
function isElement(n2) {
|
|
178
180
|
return n2.nodeType === n2.ELEMENT_NODE;
|