Fix GLTFExporter when exporting in GLTF with OffscreenCanvas (#24031)
Fix GLTFExporter when exporting in GLTF with OffscreenCanvas (#24031)

* Fix GLTFExporter when exporting in GLTF with OffscreenCanvas

And simplify promises

* Remove identation before `.then()`

* Get `toBlobPromise` from a function

* Move `getToBlobPromise` function

* Fix `getToBlobPromise`

* Clean up.

Co-authored-by: mrdoob <59bd0a3ff43b32849b319e645d4798d8a5d1e889@mrdoob.com>
gero3/three.js,aardgoose/three.js,mrdoob/three.js,gero3/three.js,aardgoose/three.js,greggman/three.js,makc/three.js.fork,WestLangley/three.js,06wj/three.js,WestLangley/three.js,Liuer/three.js,mrdoob/three.js,06wj/three.js,makc/three.js.fork,Liuer/three.js,donmccurdy/three.js,donmccurdy/three.js,greggman/three.js