Skip to content

Commit

Permalink
fix CORS
Browse files Browse the repository at this point in the history
  • Loading branch information
otacke committed Nov 23, 2017
1 parent ed00d74 commit ae558c9
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions scripts/agamotto.js
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,7 @@ H5P.Agamotto = function () {
function loadImage (path, id) {
return new Promise(function(resolve, reject) {
var image = new Image();
image.crossOrigin = 'Anonymous';
image.onload = function() {
resolve(this);
};
Expand Down
2 changes: 1 addition & 1 deletion scripts/images.js
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ var H5P = H5P || {};
var image = new Image();

// This is necessary to prevent security errors in some cases.
image.setAttribute('crossOrigin', 'anonymous');
image.crossOrigin = 'Anonymous';
image.src = imageCanvas.toDataURL('image/jpeg');
this.images[i] = image;
}
Expand Down

0 comments on commit ae558c9

Please sign in to comment.