Run notebook cross-origin isolated?

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.)

As far as I’m aware Observable’s sandbox architecture makes it impossible. There’s a related issue in our feedback repo:

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.

Since I needed it myself, here’s an example of loading the motherduck extension in Observable:

This also avoids an ugly problem in motherduck’s wasm-client package where the client continuously spams the API with failing requests if you provide an invalid token, without any way to remedy other than to reload the page (because you can’t access the worker to terminate it).

My sandbox escape is to fork the page File System Access API / Tom Larkworthy | Observable