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

Simple implementation for crossOrigin support #2

Merged
merged 1 commit into from
Feb 21, 2019
Merged

Simple implementation for crossOrigin support #2

merged 1 commit into from
Feb 21, 2019

Conversation

StigZord
Copy link
Contributor

I have added crossOrigin param to the hook for handling images from different domains.
To somewhat prevent accidental setting of crossOrigin, I implemented it the way that user need to actually write the string value Anonymous to correctly set the crossOrigin rule.

Let me know what you think.
Also if you are ok with this PR, should I bump the version too?

@lavrton
Copy link
Member

lavrton commented Feb 21, 2019

I think we should set it to anonymous by default but a user can change it.

module.exports = function useImage(url, crossOrigin) {
  //  code
  img.crossOrigin = crossOrigin || 'Anonymous';
}

@StigZord
Copy link
Contributor Author

In my opinion for safety reasons it actually shouldn't be enabled by default and instead should be a conscious decision to use.

@lavrton lavrton merged commit 3846115 into konvajs:master Feb 21, 2019
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

Successfully merging this pull request may close these issues.

2 participants