diff --git a/src/drawer.js b/src/drawer.js index 70cb1a84..dbf5f461 100644 --- a/src/drawer.js +++ b/src/drawer.js @@ -100,7 +100,8 @@ $.Drawer = function( options ) { alwaysBlend: $.DEFAULT_SETTINGS.alwaysBlend, minPixelRatio: $.DEFAULT_SETTINGS.minPixelRatio, debugMode: $.DEFAULT_SETTINGS.debugMode, - timeout: $.DEFAULT_SETTINGS.timeout + timeout: $.DEFAULT_SETTINGS.timeout, + crossOriginPolicy: $.DEFAULT_SETTINGS.crossOriginPolicy }, options ); @@ -303,7 +304,10 @@ $.Drawer.prototype = /** @lends OpenSeadragon.Drawer.prototype */{ this.downloading++; image = new Image(); - image.crossOrigin = 'Anonymous'; + + if (_this.crossOriginPolicy !== false) { + image.crossOrigin = _this.crossOriginPolicy; + } complete = function( imagesrc, resultingImage ){ _this.downloading--; diff --git a/src/openseadragon.js b/src/openseadragon.js index a151f7e3..7f395735 100644 --- a/src/openseadragon.js +++ b/src/openseadragon.js @@ -403,6 +403,10 @@ * * @property {Number} [collectionTileSize=800] * + * @property {String} [crossOriginPolicy='Anonymous'] + * Valid values are 'Anonymous', 'use-credentials', and false. If false, canvas requests will + * not use CORS, and the canvas will be tainted. + * */ /** @@ -717,6 +721,7 @@ window.OpenSeadragon = window.OpenSeadragon || function( options ){ tileSources: null, tileHost: null, initialPage: 0, + crossOriginPolicy: 'Anonymous', //PAN AND ZOOM SETTINGS AND CONSTRAINTS panHorizontal: true, diff --git a/src/viewer.js b/src/viewer.js index 157e6ef1..82068756 100644 --- a/src/viewer.js +++ b/src/viewer.js @@ -1662,7 +1662,8 @@ function openTileSource( viewer, source ) { minPixelRatio: _this.collectionMode ? 0 : _this.minPixelRatio, timeout: _this.timeout, debugMode: _this.debugMode, - debugGridColor: _this.debugGridColor + debugGridColor: _this.debugGridColor, + crossOriginPolicy: _this.crossOriginPolicy }); // Now that we have a drawer, see if it supports rotate. If not we need to remove the rotate buttons