Skip to content
This repository has been archived by the owner on Oct 28, 2021. It is now read-only.

跨域图像资源 浏览器兼容问题 #3

Closed
fghrsh opened this issue Jan 3, 2018 · 0 comments
Closed

跨域图像资源 浏览器兼容问题 #3

fghrsh opened this issue Jan 3, 2018 · 0 comments

Comments

@fghrsh
Copy link

fghrsh commented Jan 3, 2018

加载 跨域图像资源 时,Chrome 正常显示,但在 IE 和 Edge 报错

SCRIPT5022: SecurityError        live2d.js (1,138845)

查了很久,又检查了几次 Access-Control-Allow-Origin,都设置正确
最终定位到问题,居然是 crossOriginsrc 的顺序导致

live2d.js 替换 n.src=e,n.crossOrigin="Anonymous";n.crossOrigin="Anonymous",n.src=e; 后问题解决

也就是 src/PlatformManager.js 处 应改为

    var loadedImage = new Image();
    loadedImage.crossOrigin = 'Anonymous';
    loadedImage.src = path;
xiazeyu added a commit to xiazeyu/live2d-widget.js that referenced this issue Jan 13, 2018
by the way, we fixed journey-ad/live2d_src#1 and
journey-ad/live2d_src#3 , thanks for your great work!
xiazeyu added a commit to xiazeyu/live2d-widget.js that referenced this issue Jan 13, 2018
by the way, we fixed journey-ad/live2d_src#1 and
journey-ad/live2d_src#3 , thanks for your great work!
xiazeyu added a commit to xiazeyu/live2d-widget.js that referenced this issue Aug 26, 2018
by the way, we fixed journey-ad/live2d_src#1 and
journey-ad/live2d_src#3 , thanks for your great work!
xiazeyu added a commit to xiazeyu/live2d-widget.js that referenced this issue Aug 26, 2018
by the way, we fixed journey-ad/live2d_src#1 and
journey-ad/live2d_src#3 , thanks for your great work!
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant