diff options
| author | jmoenig <jens@moenig.org> | 2013-09-18 15:34:59 +0200 |
|---|---|---|
| committer | jmoenig <jens@moenig.org> | 2013-09-18 15:34:59 +0200 |
| commit | e9afcc9ec3e990eb1ebc79790fcf5048372858c1 (patch) | |
| tree | d1dbf920aa3b93174adb70e9d57cf60d9c01ad98 /gui.js | |
| parent | c0a0c1f4a7a9f3cfd055288817530cf7c46bb26d (diff) | |
| download | snap-e9afcc9ec3e990eb1ebc79790fcf5048372858c1.tar.gz snap-e9afcc9ec3e990eb1ebc79790fcf5048372858c1.zip | |
prevent costumes with imported CORS-tainted canvases
expected to fix #155, #154, #151, #148, #147, #127 for future projects
Diffstat (limited to 'gui.js')
| -rw-r--r-- | gui.js | 15 |
1 files changed, 14 insertions, 1 deletions
@@ -68,7 +68,7 @@ sb, CommentMorph, CommandBlockMorph*/ // Global stuff //////////////////////////////////////////////////////// -modules.gui = '2013-September-17'; +modules.gui = '2013-September-18'; // Declarations @@ -1488,6 +1488,19 @@ IDE_Morph.prototype.droppedImage = function (aCanvas, name) { aCanvas, name ? name.split('.')[0] : '' // up to period ); + + if (costume.isTainted()) { + this.inform( + 'Unable to import this image', + 'The picture you wish to import has been\n' + + 'tainted by a restrictive cross-origin policy\n' + + 'making it unusable for costumes in Snap!. \n\n' + + 'Try downloading this picture first to your\n' + + 'computer, and import it from there.' + ); + return; + } + this.currentSprite.addCostume(costume); this.currentSprite.wearCostume(costume); this.spriteBar.tabBar.tabTo('costumes'); |
