How to launch Browser from JupyterLab

If you are running things via Binder, you are already in a browser, right? You just need to get the service from the session to appear in a window on the browser. That is what the proxy allows.

If you start up the development server by running all the cells above (first 11 cells in the notebook), when you click on the link in the markdown just below where you started the development server while the development server is running, it opens the page served via the development server in another tab on my local Chrome browser. The basic HTML only works because the css and javascript files aren’t found correctly due to relative paths; however, it illustrates the remote server being proxied to your local browser from the session. (It doesn’t matter for your case, but to explain why I don’t care about the css and js, I’m actually planning to use a different way to let users access the hugo-built pages now based on jupyter-http-server because it works more easily and will be more in line with how the built pages will ultimately be served; I just haven’t changed the rest of tutorial to actually use it yet).

I updated the thread you referenced with a new post and now the directions should get you launching Firefox with webbrowser.open() commands in an ipython console. I don’t think that works from Jupyter because I feel there you should use the proxy.

Maybe looking at this other example will help it click more for you. Pay close attention to the ‘Setup: start the desktop’ part. Or this one is nice because it clearly illustrates how the proxy is used to open streamlit in the launch binder link. If you go here and click on the launch binder badge you can see how the SpyderIDE is run in a desktop in the browser via Jupyter to for demonstration/tour.