Comments (6)
I need a minimal reproduction to debug your issue, thanks!
Playground for https://codesandbox.io
Playground for https://codepen.io
Playground for https://play.vuejs.org
from modern-screenshot.
@qq15725 we are having d3 chart as svg in our project and trying to take screenshot of that svg, in google chrome it is taking proper screenshot of that svg but in firefox it is getting as blank white image.
from modern-screenshot.
@qq15725 we are having d3 chart as svg in our project and trying to take screenshot of that svg, in google chrome it is taking proper screenshot of that svg but in firefox it is getting as blank white image.
Is the image dataURL generated in Firefox very large and contains many redundant styles?
from modern-screenshot.
I saw this with some icons: playground
from modern-screenshot.
@qq15725 we are having d3 chart as svg in our project and trying to take screenshot of that svg, in google chrome it is taking proper screenshot of that svg but in firefox it is getting as blank white image.
Is the image dataURL generated in Firefox very large and contains many redundant styles?
Yes very large and contains many redundant styles and same problem here with d3 chart, no solution since 1 year ?
from modern-screenshot.
We had the same problem. The root cause were global css variables with embedded graphics that summed up to 8MB of variables at the global scope. It even caused modern-screenshot to crash (NS_ERROR_OUT_OF_MEMORY) in Firefox. Reducing the CSS size to ~ 50KB caused it to produce blank images in Firefox.
We solved this by moving the css variables to the scope of the element using it. After that, modern-screenshot did not have any issues producing the image anymore.
Before:
:root {
--icon-foo: url(data:image/png;base64,..............................);
}
after:
my-icon {
--icon-foo: url(data:image/png;base64,..............................);
}
In our case my-icon
is a custom element with a shadow dom, thus the variable needs to be declared at the scope of the custom element (or a ::part
). If you are not using shadow dom, you can use css classes as selectors or whatever. Just make sure the dom elements in the tree that modern-screenshot should take images of do not have too many huge variables in their scope.
Of course this workaround does not help if the screenshot should include the images that cause the huge css.
from modern-screenshot.
Related Issues (20)
- 请问如何生成底色为白色的图片🙋🏻♀️
- 圆角无法画出
- Checkbox, Radio, Select not rendering their state HOT 1
- 截取的图片顶部偏移、和左偏移很大
- Unexpected wrap caused by lost floating point precision HOT 1
- 使用domToPng在特定的OPPO Find X3等机型上,对包含图片类的dom截图处理后发现图片区域为灰色 HOT 1
- Anyway to omit so many console warnings?
- Text with both background-clip and color set occasionally fails to display in Firefox
- Remove
- 能不能不要加载css中的所有字体
- Question: is it possible for me to x, y locations of the cloned nodes and its children? HOT 1
- Fonts not getting exported in the img ? HOT 1
- 新版火狐浏览器下内容多时使用domToCanvas提示Failed image load ,图片黑屏 HOT 1
- onCloneNode回调内修改样式以及追加dom元素后,截图没有效果,应当等待onCloneNode回调执行完毕后,再继续执行截图
- Im getting low quality when exporting with domToJpeg and domToBlob
- 内容显示偏移
- 文字的字体没有在截图的图片中 HOT 2
- 如何添加多个dom节点,实现模块化截图 HOT 1
- CSS attr() in pseudo-elements doesn't work in Firefox
- Threads not closing after converting DOM to image
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from modern-screenshot.