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

getSnapshot's html2canvas code outputs taint errors and adds canvases to document.body #1756

Open
jonasanderssonswg opened this issue Dec 6, 2024 · 0 comments

Comments

@jonasanderssonswg
Copy link

Is this bug fix critical for your commercial enterprise?
We will contact you.

Describe the bug
The html2canvas part of the getSnapshot function appends generated canvases to document.body when the plugins' canvases aren't contained there.

This leads to the html2canvas function throwing a taint warning/error and the tag to grow every time getSnapshot is called. These generated canvases aren't cleaned up either.

To Reproduce
Steps to reproduce the behavior:

  1. Don't keep the canvases for the viewer and the plugins in the tag - we've put them inside a Vue JS 3 app, so like three
    deep.
  2. Use StoreyViewsPlugin, NavCubePlugin, AxisGizmoPlugin, SectionPlanesPlugin, DistanceMeasurementsPlugin plugins.
  3. Load in a file with IfcBuildingStorey objects
  4. Call StoreyViewsPlugin.createStoreyMap()

Commenting out the html2canvas loop in getSnapshot makes it behave as expected.

Expected behavior
No warnings/errors concerning canvas taint in the console output.

Document.body is never messed with, and especially is never left with garbage canvases.

We don't want to show the other plugins in the storey map, so this feature should be avoidable via config.

Screenshots
n/a

Desktop (please complete the following information):

  • OS: Win 11
  • Browser: Chrome
  • Version: 131.0.6778.86

Smartphone (please complete the following information):
n/a

Additional context
n/a

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

No branches or pull requests

1 participant