浏览代码

Avoid defaulting crossOrigin attribute

Defaulting the crossOrigin attribute to 'anonymous' causes browsers to
not send credentials along with the request, even if the request is not
cross origin (at least with Chrome). A better default is to not set the
cross origin attribute, allowing browsers to behave normally. Users in a
cross origin environment can override this value.
Scott Andrews 11 年之前
父节点
当前提交
b350f9dacf
共有 2 个文件被更改,包括 3 次插入3 次删除
  1. 1 1
      src/extras/ImageUtils.js
  2. 2 2
      src/loaders/Loader.js

+ 1 - 1
src/extras/ImageUtils.js

@@ -5,7 +5,7 @@
 
 THREE.ImageUtils = {
 
-	crossOrigin: 'anonymous',
+	crossOrigin: undefined,
 
 	loadTexture: function ( url, mapping, onLoad, onError ) {
 

+ 2 - 2
src/loaders/Loader.js

@@ -17,7 +17,7 @@ THREE.Loader.prototype = {
 
 	constructor: THREE.Loader,
 
-	crossOrigin: 'anonymous',
+	crossOrigin: undefined,
 
 	addStatusElement: function () {
 
@@ -138,7 +138,7 @@ THREE.Loader.prototype = {
 
 			};
 
-			image.crossOrigin = _this.crossOrigin;
+			if ( _this.crossOrigin !== undefined ) image.crossOrigin = _this.crossOrigin;
 			image.src = url;
 
 		}