共享arraybuffer,github页面和DNS
Buon Giorno,以下情况是:
通过github页面托管的git回购: https:https:// github .com/ossia/score-web ;我配置了github将其放在域后面 https://ossia.io 因此,在地址 https://ossia.io/score-web
wasm应用程序需要共享arrayarraybuffer
您可以检查的sharedArrayBuffer,网站 https://ossia.io/score/score-web 返回错误:
ReferenceError: SharedArrayBuffer is not defined
从Chrome检查员所说的内容中,
SharedArrayBuffers (SABs) can be used to construct high-resolution timers. High-resolution timers simplify Spectre attacks on cross-origin resources.
To mitigate security risks across browsers, SharedArrayBuffers are gated behind cross-origin isolated contexts starting with Chrome 92 (July 2021).
To continue using SharedArrayBuffers, please ensure that this page opts-into cross-origin isolation by setting Cross-Origin-Opener-Policy and Cross-Origin-Embedder-Policy appropriately.
Note that for each iframe, only the first issue is reported for performance reasons.
这是一个问题。
我该如何解决此问题:
- 必须更改URL
- 必须离开GH页面
?
Buon giorno, here is the situation:
A git repo hosted through Github pages: https://github.com/ossia/score-web ; I configured Github to put it behind the domain https://ossia.io thus at the address https://ossia.io/score-web
A WASM app which requires SharedArrayBuffer
As you can check, the website https://ossia.io/score-web returns an error:
ReferenceError: SharedArrayBuffer is not defined
Which from what the inspector of chrome says:
SharedArrayBuffers (SABs) can be used to construct high-resolution timers. High-resolution timers simplify Spectre attacks on cross-origin resources.
To mitigate security risks across browsers, SharedArrayBuffers are gated behind cross-origin isolated contexts starting with Chrome 92 (July 2021).
To continue using SharedArrayBuffers, please ensure that this page opts-into cross-origin isolation by setting Cross-Origin-Opener-Policy and Cross-Origin-Embedder-Policy appropriately.
Note that for each iframe, only the first issue is reported for performance reasons.
is a CORS issue.
How can I fix this without:
- Having to change the URL
- Having to move off GH pages
?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我设法使用以下库进行修复,该库显然可以重新加载页面并注入缺失的CORS标题:
https:/ /Github.com/gzuidhof/coi-serviceworker
我刚刚添加
到github页面网站和旁边的JS脚本的index.html中,它起作用了。
I managed to fix it with the following library which apparently reloads the page and injects the missing CORS headers:
https://github.com/gzuidhof/coi-serviceworker
I just added
to the index.html served by the Github Pages website and the JS script next to it and it worked.