Is it possible to run an Observable notebook in cross-origin isolated mode?
I’d like to know if it’s possible to use features only available in this mode, such as SharedArrayBuffer, in Observable. For example, here’s an attempt to use the MotherDuck WASM Client, which requires SharedArrayBuffer.
(Apologies if this is covered elsewhere. I searched but did not find the answer.)
1 Like
As far as I’m aware Observable’s sandbox architecture makes it impossible. There’s a related issue in our feedback repo:
opened 11:55PM - 11 Jan 24 UTC
closed 11:30AM - 12 Jan 24 UTC
**Is your feature request related to a problem? Please describe.**
Synchronous … cross worker function call emulation is not possible without SharedArrayBuffer, Atomics.wait(), Atomics.notify(). We do not have the required response headers on the content document
```
"Cross-Origin-Opener-Policy": "same-origin"
"Cross-Origin-Embedder-Policy": "require-corp"
```
These are needed to get WASI working. To emulate blocking access to filesystem handles, the WASM worker needs to be paused until JS has a response, and thus the need for Atomics over shared buffers is born. See https://github.com/wasmerio/wasmer-js
**Describe the solution you'd like**
A clear and concise description of what you want to happen.
**Describe alternatives you've considered**
A clear and concise description of any alternative solutions or features you've considered.
**Additional context**
Add any other context or screenshots about the feature request here.
I was afraid that might be the case. Thanks for the pointer.
In the unlikely event that a workaround or alternative is discovered, I’d be curious to learn about it.
@mootari - Following here, do you know if this is possible to do now in Framework?
Just like OP I’m trying to use MotherDuck’s WASM client, but as per their documentation it requires to set two HTTP headers: MotherDuck Wasm Client | MotherDuck Docs
Cross-Origin-Opener-Policy: same-origin
Cross-Origin-Embedder-Policy: require-corp
If possible, could you help me clarify where these should be passed in Framework?
Thanks a lot!
@javpascal It depends on where/how you host your Framework app. Afaik you can’t yet modify the headers of pages served through Observable Cloud.