-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Handle some quirks mode issues #123
Conversation
IE8 and 9 do not support array-style string parsing in quirks mode: "abcdef"[0] returns "" whereas "abcdef".substr(0,1) returns "a" document.fireEvent() returns "Invalid argument" regardless of the parameters sent to it. This happens in IE8 and IE9 in quirks mode.
Is it possible to write a test for this? |
I'm not too familiar with how the tests work, but let me see what I can do. This was done with trial and error in IE8/9 in quirks mode. Is it possible to run tests in IE quirks mode? |
I don't really write JavaScript, so I don't know how IE even works. I'd imagine it's possible, but I'm not sure. Either way, the code looks sane enough and safe. So it's fine. I was more or less trying to understand the problem a bit more. |
@@ -235,7 +235,7 @@ var Raven = { | |||
function triggerEvent(eventType, options) { | |||
var event, key; | |||
|
|||
eventType = 'raven' + eventType[0].toUpperCase() + eventType.substr(1); | |||
eventType = 'raven' + eventType.substr(0,1).toUpperCase() + eventType.substr(1); |
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.
fwiw, substring(0, 1)
is generally a tiny bit faster.
Handle some quirks mode issues
Add passing extra options to HTTP transport
- feat: Export getCanvasManager & allow passing it to record() [#122](getsentry/rrweb#122) - feat: Remove hooks related code, which is not used [#126](getsentry/rrweb#126) - feat: Remove plugins related code, which is not used [#123](getsentry/rrweb#123) - feat: Refactor module scope vars & export mirror & `takeFullSnapshot` directly [#113](getsentry/rrweb#113) - fix(rrweb): Fix rule.style being undefined [#121](getsentry/rrweb#121) - ref: Avoid unnecessary cloning of objects or arrays [#125](getsentry/rrweb#125) - ref: Avoid cloning events to add timestamp [#124](getsentry/rrweb#124)
- feat: Export getCanvasManager & allow passing it to record() [#122](getsentry/rrweb#122) - feat: Remove hooks related code, which is not used [#126](getsentry/rrweb#126) - feat: Remove plugins related code, which is not used [#123](getsentry/rrweb#123) - feat: Refactor module scope vars & export mirror & `takeFullSnapshot` directly [#113](getsentry/rrweb#113) - fix(rrweb): Fix rule.style being undefined [#121](getsentry/rrweb#121) - ref: Avoid unnecessary cloning of objects or arrays [#125](getsentry/rrweb#125) - ref: Avoid cloning events to add timestamp [#124](getsentry/rrweb#124)
- feat: Export getCanvasManager & allow passing it to record() [#122](getsentry/rrweb#122) - feat: Remove hooks related code, which is not used [#126](getsentry/rrweb#126) - feat: Remove plugins related code, which is not used [#123](getsentry/rrweb#123) - feat: Refactor module scope vars & export mirror & `takeFullSnapshot` directly [#113](getsentry/rrweb#113) - fix(rrweb): Fix rule.style being undefined [#121](getsentry/rrweb#121) - ref: Avoid unnecessary cloning of objects or arrays [#125](getsentry/rrweb#125) - ref: Avoid cloning events to add timestamp [#124](getsentry/rrweb#124)
- feat: Export getCanvasManager & allow passing it to record() [#122](getsentry/rrweb#122) - feat: Remove hooks related code, which is not used [#126](getsentry/rrweb#126) - feat: Remove plugins related code, which is not used [#123](getsentry/rrweb#123) - feat: Refactor module scope vars & export mirror & `takeFullSnapshot` directly [#113](getsentry/rrweb#113) - fix(rrweb): Fix rule.style being undefined [#121](getsentry/rrweb#121) - ref: Avoid unnecessary cloning of objects or arrays [#125](getsentry/rrweb#125) - ref: Avoid cloning events to add timestamp [#124](getsentry/rrweb#124) Note: With this update, canvas is _always_ excluded, unless we opt in by passing a `getCanvasManager` function to `record()`. We'll provide a way to do this once we have a fully formed canvas story. For now, this will reduce bundle size considerably for all SDK users.
> * Revert "fix: isCheckout is not included in fullsnapshot event (rrweb-io#1141)" Fixes an issue where Meta event is being lost in buffered replays. > revert: feat: Remove plugins related code, which is not used #123 > feat: Export additional canvas-related types and functions (#134) Changes needed for canvas playback > feat: Skip addHoverClass when stylesheet is >= 1MB #130 Affects playback only
> * Revert "fix: isCheckout is not included in fullsnapshot event (rrweb-io#1141)" Fixes an issue where Meta event is being lost in buffered replays. > revert: feat: Remove plugins related code, which is not used #123 > feat: Export additional canvas-related types and functions (#134) Changes needed for canvas playback > feat: Skip addHoverClass when stylesheet is >= 1MB #130 Affects playback only
"abcdef"[0]
returns""
whereas"abcdef".substr(0,1)
returns"a"
document.fireEvent()
seems to returnInvalid argument
for almost every argument passed to it in IE8 and IE9 in quirks mode so I wrapped it in a try/catch block to be safe