Преглед на файлове

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;
 
 		}