Calling JavaScript commands that depend on the context

I can’t really recommend relying on expose-app-in-browser. You’ll likely want to consider a custom postMessage API which you can reason about, and hopefully extend.

We’ve started thinking about this over on jupyterlite as well. This is likely not a feature that would land in full (retro)lab, as these kinds of integration can be rather fiddly, and vary depending on how secure you want them to be.