-
-
Notifications
You must be signed in to change notification settings - Fork 88
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
changes in Chrome 91+
#58
Comments
If it's not enabled, then isn't |
Oh right. In that case, the script is already prepared to work in an environment where |
@ljharb Out of curiosity, is there documentation somewhere that says the cross origin isolation restriction will be implemented by making the constructor undefined as opposed to throwing an error when attempting to use it? Making it undefined would make sense to do if assuming people have their apps built with backwards/cross-platform compatibility in mind, but I could also see providing the constructor and having it throw an error, as it would make it much more clear what happened to it when code suddenly starts failing. A lot of places detailing fixing this issue recommend either stopping use of SharedArrayBuffer altogether, or checking window.crossOriginIsolated before using it. I'm not sure if this is because the constructor will just throw an error, they didn't know that SharedArrayBuffer will be undefined, they are wanting to get rid of the deprecation warnings in the meantime, or some other reason I'm not thinking of. |
In Chrome 91+, a
SharedArrayBuffer
can only be created if cross-origin isolation is enabled.Affected part:
node-util/support/types.js
Line 243 in 4b1c0c7
A possible fix could be falling back to
ArrayBuffer
ifwindow.crossOriginIsolated !== true
.Related to Richienb/node-polyfill-webpack-plugin#4
The text was updated successfully, but these errors were encountered: