Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Movee absolutifyURLs call for import rules out of trycatch
  • Loading branch information
jeffdnguyen committed Jul 18, 2024
commit 772f64c087e6ccd89275f598fe51f66f04a6c21e
18 changes: 9 additions & 9 deletions packages/rrweb-snapshot/src/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -118,18 +118,18 @@ export function stringifyRule(rule: CSSRule, sheetHref: string | null): string {
stringifyStylesheet(rule.styleSheet) ||
// work around browser issues with the raw string `@import url(...)` statement
escapeImportStatement(rule);

if (rule.styleSheet.href) {
importStringified = absolutifyURLs(
importStringified,
rule.styleSheet.href,
);
}

return importStringified;
} catch (error) {
// ignore
}

if (rule.styleSheet.href) {
importStringified = absolutifyURLs(
importStringified || rule.cssText,
rule.styleSheet.href,
);
}

return importStringified || rule.cssText;
}

let ruleStringified = rule.cssText;
Expand Down