-
Notifications
You must be signed in to change notification settings - Fork 60
feat(session-replay): add background-capture support for Zoning/heatm… #1505
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
base: main
Are you sure you want to change the base?
Conversation
Add background capture support for Zoning/heatmaps by initializing
|
| }, | ||
| { once: true }, | ||
| ); | ||
| document.head?.appendChild(scriptElement); |
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.
If document.head is null, the optional chaining silently skips appendChild, leaving the promise pending forever. Consider removing ?. so the try/catch can reject the promise on failure.
| document.head?.appendChild(scriptElement); | |
| document.head.appendChild(scriptElement); |
🚀 Want me to fix this? Reply ex: "fix it for me".
2fcdd6e to
f9b440d
Compare
| } | ||
|
|
||
| try { | ||
| const { WindowMessenger } = await import('./libs/messenger'); |
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.
WindowMessenger is not exported from ./libs/messenger — only types are defined there. This import will fail at runtime.
🚀 Want me to fix this? Reply ex: "fix it for me".
… deprecated options
| const message = event.data as Message<Action>; | ||
| const { action, requestId, data } = message; |
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.
Destructuring event.data will throw if the message is null or undefined. Consider adding a guard (e.g., if (!event.data) return) before destructuring.
| const message = event.data as Message<Action>; | |
| const { action, requestId, data } = message; | |
| const message = event.data as Message<Action>; | |
| if (!message) { | |
| return; | |
| } | |
| const { action, requestId, data } = message; |
🚀 Want me to fix this? Reply ex: "fix it for me".
…ap integration
Summary
Checklist