pissang commented on a change in pull request #13732:
URL:
https://github.com/apache/incubator-echarts/pull/13732#discussion_r542086692
##########
File path: src/component/toolbox/feature/SaveAsImage.ts
##########
@@ -73,15 +73,42 @@ class SaveAsImage extends
ToolboxFeature<ToolboxSaveAsImageFeatureOption> {
}
// IE
else {
- if (window.navigator.msSaveOrOpenBlob) {
- const bstr = atob(url.split(',')[1]);
- let n = bstr.length;
- const u8arr = new Uint8Array(n);
- while (n--) {
- u8arr[n] = bstr.charCodeAt(n);
+ if (window.navigator.msSaveOrOpenBlob || isSvg) {
+ const parts = url.split(',');
+ // data:[<mime type>][;charset=<charset>][;base64],<encoded
data>
+ // see https://css-tricks.com/data-uris/
Review comment:
It's better to avoid URL referencing like this. It may have license
issues
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]