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

Examples don't render on Safari below v15 #4

Open
MalbaCato opened this issue Nov 5, 2021 · 0 comments
Open

Examples don't render on Safari below v15 #4

MalbaCato opened this issue Nov 5, 2021 · 0 comments

Comments

@MalbaCato
Copy link

MalbaCato commented Nov 5, 2021

... for a really stupid reason - it lacks the instantiateStreaming function of the WebAssembly API.

Because Apple updates the browser together with the OS, this renders it inaccessible to most Safari users.

I was able to circumvent this locally, by inserting this tiny stupid polypill snippet:

WebAssembly.instantiateStreaming = async function(f, i) {
    const responce = await f;
    const ab = await responce.arrayBuffer();
    return WebAssembly.instantiate(ab, i);   
}

Obviously care should be taken to not overwrite the method if it exists, and possibly there are problems with this that I overlooked (cause I didn't look much at all), but it shouldn't be that hard to implement.

Applies to the demos on the dedicated demo page too, of course

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant