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

canvas 사용 시 이용되는 link 태그에 crossorigin 써야 하는 이유 #6

Closed
NamJwong opened this issue Aug 29, 2022 · 1 comment
Assignees

Comments

@NamJwong
Copy link
Owner

#1 에서 font(서브셋)가 깨지는 문제가 발생해서 알아보니 font를 fetch하는 link 태그에 crossorigin="anonymous"를 설정해주면 된다고 해서 그렇게 해결했다.

(tsayen/dom-to-image#279)

그런데 이것이 무엇을 하는 것인지 이해하지 못해서 너가소개서 코드에 함부로 적용을 할 수가 없어서 제대로 그 역할을 이해하고 넘어가야겠다

@NamJwong NamJwong self-assigned this Aug 29, 2022
@NamJwong NamJwong changed the title canvas 사용 시 이용되는 link 태그에 crossorigin 써야 하는 이유 알아보기 canvas 사용 시 이용되는 link 태그에 crossorigin 써야 하는 이유 Aug 30, 2022
@NamJwong
Copy link
Owner Author

NamJwong commented Sep 2, 2022

써도 괜찮은 이유

  1. React 공식 문서에서 권장함
    https://ko.reactjs.org/docs/cdn-links.html#why-the-crossorigin-attribute

  2. 애초에 cavas API를 사용할 때 fetch되는 것들에는 CORS가 적용된다는 배경을 알게 됨.

image

https://developer.mozilla.org/ko/docs/Web/HTTP/CORS
https://developer.mozilla.org/ko/docs/Web/HTML/CORS_enabled_image

@NamJwong NamJwong closed this as completed Sep 2, 2022
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

1 participant