Buon giorno,情况如下:
通过Github页面托管的
需要SharedArrayBuffer的
正如您可以检查的,网站https://ossia.io/score-web返回一个错误:
ReferenceError: SharedArrayBuffer is not defined从铬检验员所说的:
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.是CORS的问题。
如果没有:
发布于 2022-06-15 08:24:09
我设法用以下库修复了它,该库显然重新加载了页面,并注入了丢失的CORS头:
https://github.com/gzuidhof/coi-serviceworker
我刚加了
<script src="coi-serviceworker.min.js"></script>到index.html页面服务,网站和它旁边的JS脚本,它起作用了。
https://stackoverflow.com/questions/72603171
复制相似问题