@posthog/rrweb-snapshot 0.0.19 → 0.0.21
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 +26 -6
- package/dist/rrweb-snapshot.cjs.map +1 -1
- package/dist/rrweb-snapshot.js +26 -6
- package/dist/rrweb-snapshot.js.map +1 -1
- package/dist/rrweb-snapshot.umd.cjs +26 -6
- package/dist/rrweb-snapshot.umd.cjs.map +2 -2
- package/dist/rrweb-snapshot.umd.min.cjs +13 -13
- package/dist/rrweb-snapshot.umd.min.cjs.map +3 -3
- package/package.json +1 -1
package/dist/rrweb-snapshot.cjs
CHANGED
|
@@ -235,9 +235,13 @@ function stringifyStylesheet(s) {
|
|
|
235
235
|
if (!rules) {
|
|
236
236
|
return null;
|
|
237
237
|
}
|
|
238
|
+
let sheetHref = s.href;
|
|
239
|
+
if (!sheetHref && s.ownerNode && s.ownerNode.ownerDocument) {
|
|
240
|
+
sheetHref = s.ownerNode.ownerDocument.baseURI;
|
|
241
|
+
}
|
|
238
242
|
const stringifiedRules = Array.from(
|
|
239
243
|
rules,
|
|
240
|
-
(rule2) => stringifyRule(rule2,
|
|
244
|
+
(rule2) => stringifyRule(rule2, sheetHref)
|
|
241
245
|
).join("");
|
|
242
246
|
return fixBrowserCompatibilityIssuesInCSS(stringifiedRules);
|
|
243
247
|
} catch (error) {
|
|
@@ -245,6 +249,7 @@ function stringifyStylesheet(s) {
|
|
|
245
249
|
}
|
|
246
250
|
}
|
|
247
251
|
function stringifyRule(rule2, sheetHref) {
|
|
252
|
+
var _a;
|
|
248
253
|
if (isCSSImportRule(rule2)) {
|
|
249
254
|
let importStringified;
|
|
250
255
|
try {
|
|
@@ -255,8 +260,11 @@ function stringifyRule(rule2, sheetHref) {
|
|
|
255
260
|
} catch (error) {
|
|
256
261
|
importStringified = rule2.cssText;
|
|
257
262
|
}
|
|
258
|
-
|
|
259
|
-
|
|
263
|
+
try {
|
|
264
|
+
if (importStringified && ((_a = rule2.styleSheet) == null ? void 0 : _a.href)) {
|
|
265
|
+
return absolutifyURLs(importStringified, rule2.styleSheet.href);
|
|
266
|
+
}
|
|
267
|
+
} catch {
|
|
260
268
|
}
|
|
261
269
|
return importStringified;
|
|
262
270
|
} else {
|
|
@@ -5410,6 +5418,16 @@ function createCache() {
|
|
|
5410
5418
|
stylesWithHoverClass
|
|
5411
5419
|
};
|
|
5412
5420
|
}
|
|
5421
|
+
function safeDocNode(n, options) {
|
|
5422
|
+
let stringContent = n.textContent;
|
|
5423
|
+
if (n.isStyle && options.hackCss) {
|
|
5424
|
+
try {
|
|
5425
|
+
stringContent = adaptCssForReplay(n.textContent, options.cache);
|
|
5426
|
+
} catch {
|
|
5427
|
+
}
|
|
5428
|
+
}
|
|
5429
|
+
return options.doc.createTextNode(stringContent);
|
|
5430
|
+
}
|
|
5413
5431
|
function buildNode(n, options) {
|
|
5414
5432
|
var _a;
|
|
5415
5433
|
const { doc, hackCss, cache } = options;
|
|
@@ -5558,9 +5576,11 @@ function buildNode(n, options) {
|
|
|
5558
5576
|
return node2;
|
|
5559
5577
|
}
|
|
5560
5578
|
case NodeType$1.Text:
|
|
5561
|
-
return
|
|
5562
|
-
|
|
5563
|
-
|
|
5579
|
+
return safeDocNode(n, {
|
|
5580
|
+
cache,
|
|
5581
|
+
doc,
|
|
5582
|
+
hackCss
|
|
5583
|
+
});
|
|
5564
5584
|
case NodeType$1.CDATA:
|
|
5565
5585
|
if (n.textContent.trim() === "") {
|
|
5566
5586
|
return null;
|