ソースを参照

Merge pull request #20351 from Mugen87/dev35

ImageBitmapLoader: Honor crossOrigin property.
Mr.doob 5 年 前
コミット
d16b82f00c
1 ファイル変更4 行追加1 行削除
  1. 4 1
      src/loaders/ImageBitmapLoader.js

+ 4 - 1
src/loaders/ImageBitmapLoader.js

@@ -63,7 +63,10 @@ ImageBitmapLoader.prototype = Object.assign( Object.create( Loader.prototype ),
 
 		}
 
-		fetch( url ).then( function ( res ) {
+		const fetchOptions = {};
+		fetchOptions.credentials = ( this.crossOrigin === 'anonymous' ) ? 'same-origin' : 'include';
+
+		fetch( url, fetchOptions ).then( function ( res ) {
 
 			return res.blob();