It works by injecting Javascript from the extension into your local Jupyter web pages and calling the client extension APIs. The extension itself acts as a privileged broker that brokers communication between the notebook and ChatGPT.