Skip to content
This repository has been archived by the owner on Feb 6, 2023. It is now read-only.

bugfix(loadAssets): Fix the problem that failing at requsting a base6… #134

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

voezy
Copy link

@voezy voezy commented Dec 6, 2020

Fix the problem that failing at requsting a base64 string as the src param of xhr.open in Internet Explorer.

处理IE无法使用base64字符串作为请求地址发起 xhr 请求的问题。
使用webpack打包后的base64时,若没有引入//s1.yy.com/ued_web_static/lib/jszip/3.1.4/??jszip.min.js,jszip-utils.min.js, 则在执行parser.load(base64string)后,会使用以下逻辑加载svga,

const req = new XMLHttpRequest()
req.open("GET", base64string, true);

这段逻辑在 chromium 内核的浏览器中可以正常运行,但在IE中会出现"拒绝访问"的问题,因此参考程序原有相关逻辑,作出这个修改,对base64字符串不在xhr中进行处理(考虑到不希望另外引入多一个js的情况下)。希望可以考虑下是否并入此修改。

…4 string as the src param of xhr.open in Internet Explorer.
Copy link
Contributor

@liveme liveme left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

PR中的base64处理尚未区分svga 1.x与2.x版本。svga 1.x 即使是 base64也需要依赖JSZip

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants