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

[Bug]: Getting Error "The Operation is Insecure" when setting recordCanvas option to true #1591

Open
1 task done
josephmathew900 opened this issue Oct 30, 2024 · 2 comments
Labels
bug Something isn't working

Comments

@josephmathew900
Copy link

Preflight Checklist

  • I have searched the issue tracker for a bug report that matches the one I want to file, without success.

What package is this bug report for?

rrweb

Version

2.0.0-alpha.4

Expected Behavior

No error should be thrown when setting the recordCanvas option to true.

Actual Behavior

I'm getting the error "The Operation is Insecure" when setting the recordCanvas option to true. This issue occurs in Firefox when opening the ColorPick Eyedropper extension.

Extension: https://addons.mozilla.org/en-US/firefox/addon/colorpick-eyedropper/

Steps to Reproduce

Demo: https://joseph-mathew.neetorecord.com/watch/4e4b12d9-4a2d-471b-be85-fd5eb56f8965
Sandbox: https://codesandbox.io/p/sandbox/96kqgh
Sandbox demo: https://96kqgh.csb.app/#

Testcase Gist URL

No response

Additional Information

No response

@josephmathew900 josephmathew900 added the bug Something isn't working label Oct 30, 2024
@eoghanmurray
Copy link
Contributor

Here is the canvas injected by the FF extension

<canvas id="color_pick_click_box" style=" .... cursor: url(&quot;moz-extension://c0751345-35a3-4851-9b97-2ca2568e211f/img/crosshair.png&quot;) 16 16, crosshair; display: none;"></canvas>

it's actual content is generated by the extension too, hence the failure:

SecurityError

The canvas's bitmap is not origin clean; at least some of its contents have or may have been loaded from a site other than the one from which the document itself was loaded.

@Juice10 any reason why we shouldn't add a try/catch around the toDataURL call?

@Juice10
Copy link
Contributor

Juice10 commented Dec 6, 2024

@eoghanmurray Try/catch sounds like a good solution for this as far as I'm concerned

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants