Add workaround for Chrome/Edge css import escaping bug#1287
Conversation
🦋 Changeset detectedLatest commit: 37d6c8c The changes in this PR will be included in the next version bump. This PR includes changesets to release 8 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
…om/rrweb-io/rrweb into juice10/chromium-import-escape-bug
packages/rrweb-snapshot/test/__snapshots__/integration.test.ts.snap
Outdated
Show resolved
Hide resolved
packages/rrweb-snapshot/src/utils.ts
Outdated
| // browser import didn't work due to CORS | ||
| // so we try to construct the import statement ourselves | ||
| // and check for browser compatibility issues | ||
| fixBrowserCompatibilityIssuesInCSSImports(rule) || |
There was a problem hiding this comment.
why isn't the new function in the catch (error) { return null; } branch of getCssRulesString?
also if there's a particular known CORS exception, we should be testing for it
There was a problem hiding this comment.
getCssRulesString(rule.styleSheet) (on line 115) contains a catch (error) { return null; } which catches the CORS exception.
To be completely honest I'm not sure if the extra try/catch is necessary in this function
There was a problem hiding this comment.
I'm failing to follow which null it is detecting out of the two possible code paths that return null in getCssRulesString.. I think the fixBrowserCompatibilityIssuesInCSS should be moved closer to the bit that triggers it
…RulesString and getCssRuleString based on @eoghanmurray feedback
…om/rrweb-io/rrweb into juice10/chromium-import-escape-bug
Edge and Chrome currently have a bug when escaping import statements which can break recording (and playback): https://bugs.chromium.org/p/chromium/issues/detail?id=1472259
This PR adds a workaround for this, and upgrades rrweb to typescript 4.9.5