diff --git a/src/drawer.js b/src/drawer.js index 3a4d3047..5856aa93 100644 --- a/src/drawer.js +++ b/src/drawer.js @@ -101,7 +101,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 ); @@ -325,7 +326,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 b7fa0867..2ce0a042 100644 --- a/src/openseadragon.js +++ b/src/openseadragon.js @@ -409,6 +409,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. + * */ /** @@ -723,6 +727,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 0ab02b89..74b4d644 100644 --- a/src/viewer.js +++ b/src/viewer.js @@ -1921,7 +1921,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 }); _this.drawers = [_this.drawer];