summaryrefslogtreecommitdiff
path: root/objects.js
diff options
context:
space:
mode:
Diffstat (limited to 'objects.js')
-rw-r--r--objects.js20
1 files changed, 19 insertions, 1 deletions
diff --git a/objects.js b/objects.js
index 9e61d58..398a61d 100644
--- a/objects.js
+++ b/objects.js
@@ -124,7 +124,7 @@ PrototypeHatBlockMorph*/
// Global stuff ////////////////////////////////////////////////////////
-modules.objects = '2013-September-17';
+modules.objects = '2013-September-18';
var SpriteMorph;
var StageMorph;
@@ -5246,6 +5246,24 @@ Costume.prototype.thumbnail = function (extentPoint) {
return trg;
};
+// Costume catching "tainted" canvases
+
+Costume.prototype.isTainted = function () {
+ // find out whether the canvas has been tainted by cross-origin data
+ // assumes that if reading image data throws an error it is tainted
+ try {
+ this.contents.getContext('2d').getImageData(
+ 0,
+ 0,
+ this.contents.width,
+ this.contents.height
+ );
+ } catch (err) {
+ return true;
+ }
+ return false;
+};
+
// SVG_Costume /////////////////////////////////////////////////////////////
/*