Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upSelecting a Hubs avatar throws a Security error #27211
Comments
|
I suspect that TexImage2D is being too strict - I believe it's acceptable to use CORS-unsafe image data as texture data, but we should taint the 3d canvas in that case and prevent readback from it. |
|
Nevermind, that was incorrect: https://www.khronos.org/registry/webgl/specs/latest/1.0/#4.2 |
|
Firefox request headers:
Response headers:
|
|
The problem appears to ultimate come from this code. Every indication in my testing shows that the texture loader should be passing "anonymous" there, but there somehow appears to be an instance of that loader that does not have setCrossOrigin called on it but still ends up with an undefined |
|
In particular, debugging code has verified that for the images that are failing to load,
The transpiling bug is a possibility given the code in question when running the site through unminify-js:
|
|
Ok, so more and more curious - the exact same behaviour occurs in Firefox (undefined vs. anonymous for this vs. HubsTextureLoader), but the effect is not a security error. Edit: the network monitor shows a |
|
Aha! I can reproduce the same problem in Firefox by forcing HubsTextureLoader to use the ImageLoader instead of ImageBitmapLoader. The difference with the latter is that it uses the fetch() API instead of creating an image element. The reason this makes a difference is step 6 in https://fetch.spec.whatwg.org/#request-class, which parses a string URL and sets the fallbackMode to "cors" instead of the default "no-cors". I believe we can now file an issue on Hubs about a transpiling error that breaks any browser that doesn't expose createImageBitmap, since the same error occurs in Blink as well. |
|
Filed mozilla/hubs#2616. |
|
This has been fixed upstream. |
This comes from
servo/components/script/dom/webglrenderingcontext.rs
Line 647 in 26b5f09