@posthog/rrweb-record 0.0.20 → 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.
@@ -239,9 +239,13 @@ function stringifyStylesheet(s2) {
239
239
  if (!rules2) {
240
240
  return null;
241
241
  }
242
+ let sheetHref = s2.href;
243
+ if (!sheetHref && s2.ownerNode && s2.ownerNode.ownerDocument) {
244
+ sheetHref = s2.ownerNode.ownerDocument.baseURI;
245
+ }
242
246
  const stringifiedRules = Array.from(
243
247
  rules2,
244
- (rule2) => stringifyRule(rule2, s2.href)
248
+ (rule2) => stringifyRule(rule2, sheetHref)
245
249
  ).join("");
246
250
  return fixBrowserCompatibilityIssuesInCSS(stringifiedRules);
247
251
  } catch (error) {
@@ -249,6 +253,7 @@ function stringifyStylesheet(s2) {
249
253
  }
250
254
  }
251
255
  function stringifyRule(rule2, sheetHref) {
256
+ var _a2;
252
257
  if (isCSSImportRule(rule2)) {
253
258
  let importStringified;
254
259
  try {
@@ -259,8 +264,11 @@ function stringifyRule(rule2, sheetHref) {
259
264
  } catch (error) {
260
265
  importStringified = rule2.cssText;
261
266
  }
262
- if (rule2.styleSheet.href) {
263
- return absolutifyURLs(importStringified, rule2.styleSheet.href);
267
+ try {
268
+ if (importStringified && ((_a2 = rule2.styleSheet) == null ? void 0 : _a2.href)) {
269
+ return absolutifyURLs(importStringified, rule2.styleSheet.href);
270
+ }
271
+ } catch {
264
272
  }
265
273
  return importStringified;
266
274
  } else {