-
Notifications
You must be signed in to change notification settings - Fork 695
Feature detection and running Web Assembly #84
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
Comments
We also need to solve the problem of having a native web assembly decoder that isn't new enough to run the application. In that scenario we want to fall-back as soon as possible - either to a polyfill with the new feature(s), or to an alternate fall-back wasm executable. If we do this wrong, we end up with applications that just silently fail or with dramatically compromised load times from doing the load/startup work twice. |
What will What will the What happens if it's How does the wasm |
CORS is a great question! We had a slightly related discussion in #53 w.r.t. dynamic linking. Let's make sure security folks are involved in this issue too. |
Suggest not abusing embed, which is subject to filtering and which has historical baggage about being a rectangular hole in your page for plugins. Similar thinking goes against object, if I'm not mistaken. Raced @kg's comment. I was going to argue for script, not because it's perfect (nothing is), but because it is close by construction (based on the polyfill). In particular the security mechanism and policy should not diverge without good reason. I think this takes in CORS, CSP, etc. We could add a new element that does not have a body. Adding anything with an implicit-CDATA body such as script has (which I got away with once, in 1995) is considered bad by WHATWG gurus, based on hardship updating browsers and validators, and attendant security risks. /be |
When integrating with ES6 modules, it seems natural to load a wasm module the same way as an ES6 module: For feature testing: independently we've discussed allowing both JS and WebAssembly to feature-test WebAssembly features (since the usual JS technique of testing for the existence of constructors on the global object won't be available). Inside WebAssembly code, that suggests some op that's given a string literal immediate (naming the feature) that statically evaluates to true/false. In JS code, that suggests some |
WebAssembly will be an object in JS, so this is not relevant anymore. |
The initial polyfill will unconditionally load JavaScript code, then load the Web Assembly binary blob, and somehow translate it to a form that'll execute using the JavaScript VM.
Once we have native support this polyfill will be a fallback: developer's code should only load the polyfill and use it if Web Assembly isn't natively supported.
How will we detect native Web Assembly support? Something like
navigator.mimeTypes['application/x-wasm'] !== undefined
?How will we trigger the browser's native support? Use an
<embed>
or<script>
tag?The text was updated successfully, but these errors were encountered: