Skip to content

Commit

Permalink
feat: support strict Safari CORS on image loading.
Browse files Browse the repository at this point in the history
  • Loading branch information
bhouston committed Sep 4, 2020
1 parent 9280448 commit ed9ac04
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/lib/textures/loaders/Image.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
export function fetchImage(url: string): Promise<HTMLImageElement> {
return new Promise<HTMLImageElement>((resolve, reject) => {
const image = new Image();
image.crossOrigin = "anonymous";
image.addEventListener("load", () => resolve(image));
image.addEventListener("error", () => {
reject(new Error(`failed to load image: ${url}`));
Expand Down

0 comments on commit ed9ac04

Please sign in to comment.