-
Notifications
You must be signed in to change notification settings - Fork 5
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: Fix CSS rules captured in Safari #86
Conversation
Safari does not escape `:` in attribute selectors correctly, so we need to do that instead.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I know there's a unit test, but can we verify this doesn't break for Chrome? I can test it when I'm back next week if you're busy with other stuff.
OK, so I tried this, and a problem is that |
Ah right, it might be
|
Is it possible this can fix the issue? If not I wonder if there's an alternative work around then so we can unblock folks |
@@ -78,7 +91,7 @@ function isCSSImportRule(rule: CSSRule): rule is CSSImportRule { | |||
function stringifyStyleSheet(sheet: CSSStyleSheet): string { | |||
return sheet.cssRules | |||
? Array.from(sheet.cssRules) | |||
.map((rule) => rule.cssText || '') | |||
.map((rule) => rule.cssText ? validateStringifiedCssRule(rule.cssText) : '') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should work now for inline css
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nice, could you verify this with an actual example app?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@mydea Tested this out and it seems to work
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nice, feel free to merge then!
Thanks guys! |
- fix: Fix some input masking (esp for radio buttons) (getsentry/rrweb#85) - fix: Unescaped `:` in CSS rule from Safari (getsentry/rrweb#86) - feat: Define custom elements (web components) (getsentry/rrweb#87)
Safari does not escape
:
in attribute selectors correctly, so we need to do that instead.See rrweb-io#1208
ref getsentry/sentry-javascript#7703