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