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

fix(record): Catch exceptions when accessing window.document #242

Merged
merged 2 commits into from
Feb 26, 2025

Conversation

billyvg
Copy link
Member

@billyvg billyvg commented Feb 24, 2025

In CanvasManager, catch exceptions when accessing window.document as it can throw a SecurityError:

"SecurityError: Failed to read a named property 'document' from 'Window': An attempt was made to break through the security policy of the user agent."

Fixes JAVASCRIPT-2X1A

In CanvasManager, catch exceptions when accessing `window.document` as it can throw a `SecurityError`:

Fixes JAVASCRIPT-2X1A
@billyvg billyvg requested review from a team and chargome February 25, 2025 19:04
@billyvg billyvg marked this pull request as ready for review February 25, 2025 19:04
Comment on lines 433 to 434
if (_document) {
searchCanvas(_document);
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I didn't include this in the try block in case searchCanvas() throws

Copy link
Member

@chargome chargome left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good !

@billyvg billyvg merged commit 8263d7d into sentry-v2 Feb 26, 2025
15 checks passed
@billyvg billyvg deleted the fix-record-try-catch-window-document branch February 26, 2025 14:30
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