Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FileLoader: Add response headers to onProgress callback #23896

Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion docs/api/en/loaders/AnimationLoader.html
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ <h3>[method:undefined load]( [param:String url], [param:Function onLoad], [param
[page:String url] — the path or URL to the file. This can also be a
[link:https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/Data_URIs Data URI].<br />
[page:Function onLoad] — Will be called when load completes. The argument will be the loaded [page:AnimationClip animation clips].<br />
[page:Function onProgress] (optional) — Will be called while load progresses. The argument will be the ProgressEvent instance, which contains .[page:Boolean lengthComputable], .[page:Integer total] and .[page:Integer loaded]. If the server does not set the Content-Length header; .[page:Integer total] will be 0.<br />
[page:Function onProgress] (optional) — Will be called while load progresses. The argument will contain [link:https://developer.mozilla.org/en-US/docs/Web/API/ProgressEvent/lengthComputable lengthComputable], [link:https://developer.mozilla.org/en-US/docs/Web/API/ProgressEvent/total total], [link:https://developer.mozilla.org/en-US/docs/Web/API/ProgressEvent/loaded loaded] and the [link:https://developer.mozilla.org/en-US/docs/Web/API/Response response]. If the server does not set the Content-Length header; [page:Integer total] will be 0.<br />
[page:Function onError] (optional) — Will be called if load errors.<br /><br />

Begin loading from url and pass the loaded animation to onLoad.
Expand Down
2 changes: 1 addition & 1 deletion docs/api/en/loaders/AudioLoader.html
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ <h3>[method:undefined load]( [param:String url], [param:Function onLoad], [param
[page:String url] — the path or URL to the file. This can also be a
[link:https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/Data_URIs Data URI].<br />
[page:Function onLoad] — Will be called when load completes. The argument will be the loaded text response.<br />
[page:Function onProgress] (optional) — Will be called while load progresses. The argument will be the ProgressEvent instance, which contains .[page:Boolean lengthComputable], .[page:Integer total] and .[page:Integer loaded]. If the server does not set the Content-Length header; .[page:Integer total] will be 0.<br />
[page:Function onProgress] (optional) — Will be called while load progresses. The argument will contain [link:https://developer.mozilla.org/en-US/docs/Web/API/ProgressEvent/lengthComputable lengthComputable], [link:https://developer.mozilla.org/en-US/docs/Web/API/ProgressEvent/total total], [link:https://developer.mozilla.org/en-US/docs/Web/API/ProgressEvent/loaded loaded] and the [link:https://developer.mozilla.org/en-US/docs/Web/API/Response response]. If the server does not set the Content-Length header; [page:Integer total] will be 0.<br />
[page:Function onError] (optional) — Will be called when load errors.<br />
</p>
<p>
Expand Down
2 changes: 1 addition & 1 deletion docs/api/en/loaders/BufferGeometryLoader.html
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ <h3>[method:undefined load]( [param:String url], [param:Function onLoad], [param
[page:String url] — the path or URL to the file. This can also be a
[link:https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/Data_URIs Data URI].d<br />
[page:Function onLoad] — Will be called when load completes. The argument will be the loaded [page:BufferGeometry].<br />
[page:Function onProgress] (optional) — Will be called while load progresses. The argument will be the ProgressEvent instance, which contains .[page:Boolean lengthComputable], .[page:Integer total] and .[page:Integer loaded]. If the server does not set the Content-Length header; .[page:Integer total] will be 0.<br />
[page:Function onProgress] (optional) — Will be called while load progresses. The argument will contain [link:https://developer.mozilla.org/en-US/docs/Web/API/ProgressEvent/lengthComputable lengthComputable], [link:https://developer.mozilla.org/en-US/docs/Web/API/ProgressEvent/total total], [link:https://developer.mozilla.org/en-US/docs/Web/API/ProgressEvent/loaded loaded] and the [link:https://developer.mozilla.org/en-US/docs/Web/API/Response response]. If the server does not set the Content-Length header; [page:Integer total] will be 0.<br />
[page:Function onError] (optional) — Will be called when load errors.<br />
</p>
<p>
Expand Down
2 changes: 1 addition & 1 deletion docs/api/en/loaders/CompressedTextureLoader.html
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ <h3>[method:CompressedTexture load]( [param:String url], [param:Function onLoad]
[page:String url] — the path or URL to the file. This can also be a
[link:https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/Data_URIs Data URI].<br />
[page:Function onLoad] (optional) — Will be called when load completes. The argument will be the loaded texture.<br />
[page:Function onProgress] (optional) — Will be called while load progresses. The argument will be the ProgressEvent instance, which contains .[page:Boolean lengthComputable], .[page:Integer total] and .[page:Integer loaded]. If the server does not set the Content-Length header; .[page:Integer total] will be 0.<br />
[page:Function onProgress] (optional) — Will be called while load progresses. The argument will contain [link:https://developer.mozilla.org/en-US/docs/Web/API/ProgressEvent/lengthComputable lengthComputable], [link:https://developer.mozilla.org/en-US/docs/Web/API/ProgressEvent/total total], [link:https://developer.mozilla.org/en-US/docs/Web/API/ProgressEvent/loaded loaded] and the [link:https://developer.mozilla.org/en-US/docs/Web/API/Response response]. If the server does not set the Content-Length header; [page:Integer total] will be 0.<br />
[page:Function onError] (optional) — Will be called when load errors.<br />
</p>
<p>
Expand Down
2 changes: 1 addition & 1 deletion docs/api/en/loaders/DataTextureLoader.html
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ <h3>[method:DataTexture load]( [param:String url], [param:Function onLoad], [par
[page:String url] — the path or URL to the file. This can also be a
[link:https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/Data_URIs Data URI].<br />
[page:Function onLoad] (optional) — Will be called when load completes. The argument will be the loaded texture.<br />
[page:Function onProgress] (optional) — Will be called while load progresses.The argument will be the ProgressEvent instance, which contains .[page:Boolean lengthComputable], .[page:Integer total] and .[page:Integer loaded]. If the server does not set the Content-Length header; .[page:Integer total] will be 0.<br />
[page:Function onProgress] (optional) — Will be called while load progresses. The argument will contain [link:https://developer.mozilla.org/en-US/docs/Web/API/ProgressEvent/lengthComputable lengthComputable], [link:https://developer.mozilla.org/en-US/docs/Web/API/ProgressEvent/total total], [link:https://developer.mozilla.org/en-US/docs/Web/API/ProgressEvent/loaded loaded] and the [link:https://developer.mozilla.org/en-US/docs/Web/API/Response response]. If the server does not set the Content-Length header; [page:Integer total] will be 0.<br />
[page:Function onError] (optional) — Will be called when load errors.<br />
</p>
<p>
Expand Down
2 changes: 1 addition & 1 deletion docs/api/en/loaders/FileLoader.html
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ <h3>[method:undefined load]( [param:String url], [param:Function onLoad], [param
[page:String url] — the path or URL to the file. This can also be a
[link:https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/Data_URIs Data URI].<br />
[page:Function onLoad] (optional) — Will be called when loading completes. The argument will be the loaded response.<br />
[page:Function onProgress] (optional) — Will be called while load progresses. The argument will be the ProgressEvent instance, which contains .[page:Boolean lengthComputable], .[page:Integer total] and .[page:Integer loaded]. If the server does not set the Content-Length header; .[page:Integer total] will be 0.<br />
[page:Function onProgress] (optional) — Will be called while load progresses. The argument will contain [link:https://developer.mozilla.org/en-US/docs/Web/API/ProgressEvent/lengthComputable lengthComputable], [link:https://developer.mozilla.org/en-US/docs/Web/API/ProgressEvent/total total], [link:https://developer.mozilla.org/en-US/docs/Web/API/ProgressEvent/loaded loaded] and the [link:https://developer.mozilla.org/en-US/docs/Web/API/Response response]. If the server does not set the Content-Length header; [page:Integer total] will be 0.<br />
[page:Function onError] (optional) — Will be called if an error occurs.<br /><br />

Load the URL and pass the response to the onLoad function.
Expand Down
2 changes: 1 addition & 1 deletion docs/api/en/loaders/Loader.html
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ <h3>[method:undefined load]()</h3>
<h3>[method:Promise loadAsync]( [param:String url], [param:Function onProgress] )</h3>
<p>
[page:String url] — A string containing the path/URL of the file to be loaded.<br />
[page:Function onProgress] (optional) — A function to be called while the loading is in progress. The argument will be the ProgressEvent instance, which contains .[page:Boolean lengthComputable], .[page:Integer total] and .[page:Integer loaded]. If the server does not set the Content-Length header; .[page:Integer total] will be 0.<br />
[page:Function onProgress] (optional) — Will be called while load progresses. The argument will contain [link:https://developer.mozilla.org/en-US/docs/Web/API/ProgressEvent/lengthComputable lengthComputable], [link:https://developer.mozilla.org/en-US/docs/Web/API/ProgressEvent/total total], [link:https://developer.mozilla.org/en-US/docs/Web/API/ProgressEvent/loaded loaded] and the [link:https://developer.mozilla.org/en-US/docs/Web/API/Response response]. If the server does not set the Content-Length header; [page:Integer total] will be 0.<br />
</p>
<p>
This method is equivalent to [page:.load], but returns a [link:https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise Promise].
Expand Down
2 changes: 1 addition & 1 deletion docs/api/en/loaders/MaterialLoader.html
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ <h3>[method:undefined load]( [param:String url], [param:Function onLoad], [param
[page:String url] — the path or URL to the file. This can also be a
[link:https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/Data_URIs Data URI].<br />
[page:Function onLoad] — Will be called when load completes. The argument will be the loaded [page:Material].<br />
[page:Function onProgress] (optional) — Will be called while load progresses. The argument will be the ProgressEvent instance, which contains .[page:Boolean lengthComputable], .[page:Integer total] and .[page:Integer loaded]. If the server does not set the Content-Length header; .[page:Integer total] will be 0.<br />
[page:Function onProgress] (optional) — Will be called while load progresses. The argument will contain [link:https://developer.mozilla.org/en-US/docs/Web/API/ProgressEvent/lengthComputable lengthComputable], [link:https://developer.mozilla.org/en-US/docs/Web/API/ProgressEvent/total total], [link:https://developer.mozilla.org/en-US/docs/Web/API/ProgressEvent/loaded loaded] and the [link:https://developer.mozilla.org/en-US/docs/Web/API/Response response]. If the server does not set the Content-Length header; [page:Integer total] will be 0.<br />
[page:Function onError] (optional) — Will be called when load errors.<br /><br />

Begin loading from url.
Expand Down
2 changes: 1 addition & 1 deletion docs/api/en/loaders/ObjectLoader.html
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ <h3>[method:undefined load]( [param:String url], [param:Function onLoad], [param
[page:String url] — the path or URL to the file. This can also be a
[link:https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/Data_URIs Data URI].<br />
[page:Function onLoad] — Will be called when load completes. The argument will be the loaded [page:Object3D object].<br />
[page:Function onProgress] (optional) — Will be called while load progresses. The argument will be the ProgressEvent instance, which contains .[page:Boolean lengthComputable], .[page:Integer total] and .[page:Integer loaded]. If the server does not set the Content-Length header; .[page:Integer total] will be 0.<br />
[page:Function onProgress] (optional) — Will be called while load progresses. The argument will contain [link:https://developer.mozilla.org/en-US/docs/Web/API/ProgressEvent/lengthComputable lengthComputable], [link:https://developer.mozilla.org/en-US/docs/Web/API/ProgressEvent/total total], [link:https://developer.mozilla.org/en-US/docs/Web/API/ProgressEvent/loaded loaded] and the [link:https://developer.mozilla.org/en-US/docs/Web/API/Response response]. If the server does not set the Content-Length header; [page:Integer total] will be 0.<br />
[page:Function onError] (optional) — Will be called when load errors.<br />
</p>
<p>
Expand Down
2 changes: 1 addition & 1 deletion docs/examples/en/loaders/3DMLoader.html
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ <h3>[method:undefined load]( [param:String url], [param:Function onLoad], [param
<p>
[page:String url] — A string containing the path/URL of the <em>.3dm</em> file.<br />
[page:Function onLoad] — A function to be called after the loading is successfully completed.<br />
[page:Function onProgress] — (optional) A function to be called while the loading is in progress. The argument will be the XMLHttpRequest instance, that contains .[page:Integer total] and .[page:Integer loaded] bytes. If the server does not set the Content-Length header; .[page:Integer total] will be 0.<br />
[page:Function onProgress] — (optional) Will be called while load progresses. The argument will contain [link:https://developer.mozilla.org/en-US/docs/Web/API/ProgressEvent/lengthComputable lengthComputable], [link:https://developer.mozilla.org/en-US/docs/Web/API/ProgressEvent/total total], [link:https://developer.mozilla.org/en-US/docs/Web/API/ProgressEvent/loaded loaded] and the [link:https://developer.mozilla.org/en-US/docs/Web/API/Response response]. If the server does not set the Content-Length header; [page:Integer total] will be 0.<br />
[page:Function onError] — (optional) A function to be called if an error occurs during loading. The function receives error as an argument.<br />
</p>
<p>
Expand Down
2 changes: 1 addition & 1 deletion docs/examples/en/loaders/DRACOLoader.html
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ <h3>[method:undefined load]( [param:String url], [param:Function onLoad], [param
<p>
[page:String url] — A string containing the path/URL of the <em>.drc</em> file.<br />
[page:Function onLoad] — A function to be called after the loading is successfully completed.<br />
[page:Function onProgress] — (optional) A function to be called while the loading is in progress. The argument will be the XMLHttpRequest instance, that contains .[page:Integer total] and .[page:Integer loaded] bytes. If the server does not set the Content-Length header; .[page:Integer total] will be 0.<br />
[page:Function onProgress] — (optional) Will be called while load progresses. The argument will contain [link:https://developer.mozilla.org/en-US/docs/Web/API/ProgressEvent/lengthComputable lengthComputable], [link:https://developer.mozilla.org/en-US/docs/Web/API/ProgressEvent/total total], [link:https://developer.mozilla.org/en-US/docs/Web/API/ProgressEvent/loaded loaded] and the [link:https://developer.mozilla.org/en-US/docs/Web/API/Response response]. If the server does not set the Content-Length header; [page:Integer total] will be 0.<br />
[page:Function onError] — (optional) A function to be called if an error occurs during loading. The function receives error as an argument.<br />
</p>
<p>
Expand Down
2 changes: 1 addition & 1 deletion docs/examples/en/loaders/FontLoader.html
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ <h3>[method:undefined load]( [param:String url], [param:Function onLoad], [param
[page:String url] — the path or URL to the file. This can also be a
[link:https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/Data_URIs Data URI].<br />
[page:Function onLoad] — Will be called when load completes. The argument will be the loaded font.<br />
[page:Function onProgress] — Will be called while load progresses. The argument will be the XMLHttpRequest instance, which contains .[page:Integer total] and .[page:Integer loaded] bytes. If the server does not set the Content-Length header; .[page:Integer total] will be 0.<br />
[page:Function onProgress] — Will be called while load progresses. The argument will contain [link:https://developer.mozilla.org/en-US/docs/Web/API/ProgressEvent/lengthComputable lengthComputable], [link:https://developer.mozilla.org/en-US/docs/Web/API/ProgressEvent/total total], [link:https://developer.mozilla.org/en-US/docs/Web/API/ProgressEvent/loaded loaded] and the [link:https://developer.mozilla.org/en-US/docs/Web/API/Response response]. If the server does not set the Content-Length header; [page:Integer total] will be 0.<br />
[page:Function onError] — Will be called when load errors.<br /><br />

Begin loading from url and pass the loaded [page:Texture texture] to onLoad.
Expand Down
2 changes: 1 addition & 1 deletion docs/examples/en/loaders/GLTFLoader.html
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,7 @@ <h3>[method:undefined load]( [param:String url], [param:Function onLoad], [param
<p>
[page:String url] — A string containing the path/URL of the <em>.gltf</em> or <em>.glb</em> file.<br />
[page:Function onLoad] — A function to be called after the loading is successfully completed. The function receives the loaded JSON response returned from [page:Function parse].<br />
[page:Function onProgress] — (optional) A function to be called while the loading is in progress. The argument will be the XMLHttpRequest instance, that contains .[page:Integer total] and .[page:Integer loaded] bytes. If the server does not set the Content-Length header; .[page:Integer total] will be 0.<br />
[page:Function onProgress] — (optional) Will be called while load progresses. The argument will contain [link:https://developer.mozilla.org/en-US/docs/Web/API/ProgressEvent/lengthComputable lengthComputable], [link:https://developer.mozilla.org/en-US/docs/Web/API/ProgressEvent/total total], [link:https://developer.mozilla.org/en-US/docs/Web/API/ProgressEvent/loaded loaded] and the [link:https://developer.mozilla.org/en-US/docs/Web/API/Response response]. If the server does not set the Content-Length header; [page:Integer total] will be 0.<br />
[page:Function onError] — (optional) A function to be called if an error occurs during loading. The function receives error as an argument.<br />
</p>
<p>
Expand Down
2 changes: 1 addition & 1 deletion docs/examples/en/loaders/KTX2Loader.html
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ <h3>[method:CompressedTexture load]( [param:String url], [param:Function onLoad]
<p>
[page:String url] — A string containing the path/URL of the <em>.basis</em> file.<br />
[page:Function onLoad] — A function to be called after the loading is successfully completed.<br />
[page:Function onProgress] — (optional) A function to be called while the loading is in progress. The argument will be the XMLHttpRequest instance, that contains .[page:Integer total] and .[page:Integer loaded] bytes. If the server does not set the Content-Length header; .[page:Integer total] will be 0.<br />
[page:Function onProgress] — (optional) Will be called while load progresses. The argument will contain [link:https://developer.mozilla.org/en-US/docs/Web/API/ProgressEvent/lengthComputable lengthComputable], [link:https://developer.mozilla.org/en-US/docs/Web/API/ProgressEvent/total total], [link:https://developer.mozilla.org/en-US/docs/Web/API/ProgressEvent/loaded loaded] and the [link:https://developer.mozilla.org/en-US/docs/Web/API/Response response]. If the server does not set the Content-Length header; [page:Integer total] will be 0.<br />
[page:Function onError] — (optional) A function to be called if an error occurs during loading. The function receives error as an argument.<br />
</p>
<p>
Expand Down
Loading