GoogleChromeLabs / wasm-feature-detect

A small library to detect which features of WebAssembly are supported.

Home Page:https://webassembly.org/roadmap

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

`threads` test (possibly others) broken on library's demo webpage

FlippingBinary opened this issue · comments

I hope this is the right place to alert the person who controls the website that demonstrates this library. I'm opening this issue here because the source code for the website appears to be hosted in this repository.

I believe this issue is related to the security requirements that were added to SharedArrayBuffer. The website does not appear to be cross origin isolated.

Steps to reproduce:

  1. Visit this library's demo webpage at https://wasm-feature-detect.surma.technology
  2. Observe failed threads test.
  3. Open browser console, type crossOriginIsolated - it is false.

Steps to confirm browser actually does support web assembly threads and cross origin isolation is likely cause of the difference:

  1. Visit wasm-bindgen-rayon demo webpage at https://rreverser.com/wasm-bindgen-rayon-demo/
  2. Compare results of single-threaded vs multi-threaded - multi-threaded is faster.
  3. Open browser console, type crossOriginIsolated - it is true.

Possible solution:

  • Add security headers to deployment server's configuration.

Thanks for the report. The "official" demo page is https://webassembly.org/roadmap/, though, and there it works:

Screenshot 2023-12-08 at 18 09 13

@surma, you may want to fix your headers.