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