Jupyter.notebook not present in Chrome JS

Hi,

I’m trying to implement something similar to this Chrome extension, but my extension code fails on a jupyter.org-hosted notebook on because Jupyter.notebook.kerrnel is not present. consolel.log shows there’s no top-level Jupyter namespace (window.Jupyter is not present). Same for a notebook running locally.

Am I doing something wrong? I see lots of references to Jupyter.notebook.kerrnel online. I also see that jupyter.org-hosted notebooks have _JUPYTERLAB namespace, but it’s not clear how to use it.

Thanks,
Simon

Can you provide a link to an example of such a notebook?

I meant the standard JupyterLite notebook.

Same problem with Google Colab notebooks.

Those would probably be very different issues.

JupyterLite’s kernel is the Pyodide-based one that runs inside your browser’s web assembly.

Google Colab is running in a more traditional Python-based kernel (more like ipykernel, hopefully you get the point) that is running on a remote virtual machine.