Skip to content
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

Merged
merged 2 commits into from
Aug 24, 2013
Merged

Conversation

jbuckner
Copy link
Contributor

  • 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() seems to return Invalid 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

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.
@mattrobenolt
Copy link
Contributor

Is it possible to write a test for this?

@jbuckner
Copy link
Contributor Author

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?

@mattrobenolt
Copy link
Contributor

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);
Copy link
Contributor

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.

mattrobenolt added a commit that referenced this pull request Aug 24, 2013
Handle some quirks mode issues
@mattrobenolt mattrobenolt merged commit 67ad604 into getsentry:master Aug 24, 2013
@kahnvex kahnvex deleted the quirks_mode_fixes branch November 5, 2014 22:04
kamilogorek pushed a commit that referenced this pull request Jun 12, 2018
Add passing extra options to HTTP transport
mydea added a commit that referenced this pull request Oct 31, 2023
- 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)
mydea added a commit that referenced this pull request Oct 31, 2023
- 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)
mydea added a commit that referenced this pull request Oct 31, 2023
- 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)
mydea added a commit that referenced this pull request Oct 31, 2023
- 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.
billyvg added a commit that referenced this pull request Dec 12, 2023
> * 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
billyvg added a commit that referenced this pull request Dec 12, 2023
> * 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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants