-
Notifications
You must be signed in to change notification settings - Fork 8.2k
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
[Screenshotting] Added workaround for webgl driven canvases #131907
[Screenshotting] Added workaround for webgl driven canvases #131907
Conversation
Pinging @elastic/kibana-reporting-services (Team:Reporting Services) |
Pinging @elastic/kibana-app-services (Team:AppServicesUx) |
@elasticmachine merge upstream |
💚 Build SucceededMetrics [docs]
History
To update your PR or re-run it, just comment with: |
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.
LGTM
Hopefully Chrome will fix this webgl issue with page.pdf() soon!
const img = document.createElement('img'); | ||
img.src = (thisCanvas as HTMLCanvasElement).toDataURL('image/png'); | ||
newDiv.appendChild(img); | ||
thisCanvas.parentNode!.replaceChild(newDiv, thisCanvas); |
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.
cc @elastic/kibana-gis
for awareness: In print-layout PDF reports, we found a bug in Chromium that forces us to capture a screenshot of the map, and then replace the canvas element with the screenshot, before we take the PDF.
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.
This applies to lens charts as well, as Lens canvas tags.
…131907) * added workaround for webgl driven canvases * expand comment with link to origin of idea Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
Summary
TL;DR additional mitigation for potentially getting blank maps in PDFs. Tested with 20 PDFs.
Added a long comment in the code to explain the reasoning behind the change.
Samples
Related