@appsurify-testmap/rrweb-snapshot 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-snapshot.cjs +5 -3
- package/dist/rrweb-snapshot.cjs.map +1 -1
- package/dist/rrweb-snapshot.js +5 -3
- package/dist/rrweb-snapshot.js.map +1 -1
- package/dist/rrweb-snapshot.umd.cjs +5 -3
- package/dist/rrweb-snapshot.umd.cjs.map +2 -2
- package/dist/rrweb-snapshot.umd.min.cjs +1 -1
- package/dist/rrweb-snapshot.umd.min.cjs.map +2 -2
- package/package.json +3 -3
package/dist/rrweb-snapshot.cjs
CHANGED
|
@@ -161,16 +161,18 @@ function getXPath(n) {
|
|
|
161
161
|
if (n === document.body) {
|
|
162
162
|
return "/html/body";
|
|
163
163
|
}
|
|
164
|
+
if (!n.tagName) {
|
|
165
|
+
return "";
|
|
166
|
+
}
|
|
164
167
|
const parentNode2 = index.parentNode(n);
|
|
165
168
|
if (!parentNode2 || !(parentNode2 instanceof Element)) {
|
|
166
169
|
return "";
|
|
167
170
|
}
|
|
168
171
|
const siblings = Array.from(parentNode2.children).filter(
|
|
169
|
-
(node2) => node2.tagName === n.tagName
|
|
172
|
+
(node2) => node2.tagName && node2.tagName === n.tagName
|
|
170
173
|
);
|
|
171
174
|
const index$1 = siblings.length > 1 ? `[${siblings.indexOf(n) + 1}]` : "";
|
|
172
|
-
|
|
173
|
-
return path;
|
|
175
|
+
return getXPath(parentNode2) + "/" + n.tagName.toLowerCase() + index$1;
|
|
174
176
|
}
|
|
175
177
|
function isElement(n) {
|
|
176
178
|
return n.nodeType === n.ELEMENT_NODE;
|