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

SharedArrayBuffer restricted in new browser versions #45

Open
bar9 opened this issue Sep 17, 2021 · 11 comments
Open

SharedArrayBuffer restricted in new browser versions #45

bar9 opened this issue Sep 17, 2021 · 11 comments

Comments

@bar9
Copy link

bar9 commented Sep 17, 2021

Describe the bug

A downstream project as well as the demo on https://rhysd.github.io/vim.wasm/ are now broken on most browsers, since SharedArrayBuffer has been disabled

Steps To Reproduce

Run https://rhysd.github.io/vim.wasm/

Expected behavior

vim opens up

Actual behavior

Alert popup with message FATAL: SharedArrayBuffer is not supported by this browser. If you're using Firefox or Safari, please enable feature flag.

Screenshots/DevTools console (if possible)

Your environment

  • OS: Win10
  • Browser: Chrome
  • Browser Version: 93

Additional context (if any)

https://caniuse.com/?search=SharedArrayBuffer
https://hacks.mozilla.org/2020/07/safely-reviving-shared-memory/

@bar9
Copy link
Author

bar9 commented Sep 17, 2021

Looking into this for my downstream project. If setting the COEP and COOP headers will succeed, I will follow up with a PR here as well.

@rhysd
Copy link
Owner

rhysd commented Sep 17, 2021

Thank you for reporting this. SharedArrayBuffer and atomics are mandatory for this project. I've not looked into this yet, but we'd need to use ServiceWorker to address this on GitHub Pages.

https://dev.to/stefnotch/enabling-coop-coep-without-touching-the-server-2d3n

@bar9
Copy link
Author

bar9 commented Sep 17, 2021

I can confirm that setting the headers below resolved the bug for my project (server side however):

        { "key": "Cross-Origin-Embedder-Policy", "value": "require-corp" },
        { "key": "Cross-Origin-Opener-Policy", "value": "same-origin" }

@rhysd
Copy link
Owner

rhysd commented Sep 17, 2021

Yes, setting the headers in server side is the easiest way. But https://rhysd.github.io/vim.wasm is hosted on GitHub Pages and it does not provide a way to customize headers.

rhysd added a commit that referenced this issue Sep 18, 2021
@mjobuda
Copy link

mjobuda commented Sep 21, 2021

Can confirm this bug on linux current firefox & brave

@rhysd
Copy link
Owner

rhysd commented Sep 22, 2021

It would not work on other browsers also. Since I joined Chrome's origin trial, it now works only on Chrome and Chromium.

@SahidMiller

This comment has been minimized.

@rhysd

This comment has been minimized.

@HKalbasi
Copy link

HKalbasi commented Jan 8, 2022

Netlify allows to set coop and coep headers and is free and as easy to use as gh-pages. Would you care to host this on netlify in addtion to gh-pages?

@Zireael07
Copy link

README says any Chrome-based browser works but this is not the case. I use Vivaldi and it doesn't work.

Either it should be fixed or readme updated to mention how to work around

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

7 participants