flems.io
flems.io copied to clipboard
Investigate the Cross-Origin-Opener-Policy/Cross-Origin-Embedder-Policy headers
I was trying to play with Atomics.waitAsync which and SharedArrayBuffers, which are enabled when the Cross-Origin-Opener-Policy and Cross-Origin-Embedder-Policy headers are set to a secure value.
That headers also enables precise performance.now() timers, which is pretty cool (see https://hacks.mozilla.org/2020/07/safely-reviving-shared-memory/ for an overview).
These don't work in flems right now, and, given how flems works, I'm not sure it could be made to work at all. Unpkg supports CORS, but fetching arbitrary 3rd party scripts and resources wouldn't always work. Even then, Safari doesn't support wildcard CORS.
An compromise could be to serve Flems in COOP/COEP mode from another subdomain, but that may too much of a hassle on your end...
Hey @pygy - Anything looking better on this front a little year later? Let me know if there's a quick fix I could do, and I'll gladly add it.