Skip to content
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

为什么跨域请求关闭后才能打开别的链接图片?不应该为True然后可以打开别的链接图片? #63

Open
jrenc2002 opened this issue May 4, 2024 · 1 comment

Comments

@jrenc2002
Copy link

No description provided.

@Dave-12138
Copy link

那玩意其实是img标签的crossorigin属性,img标签不带crossorigin时不验证跨域(就是不带origin请求头),此时浏览器认为该img标签显示的图片是“被污染的”,不允许这样的img标签被canvas使用。
crossorigin让img标签加载图片时验证跨域,此时img标签不会被标记为“被污染”,可以被canvas使用。
综上,那个叫crossOrigin的参数其实不是允许跨域的意思,而是开启跨域验证

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

No branches or pull requests

2 participants