There are plenty blogs about running JupyterLab as a desktop app using Chrome/Chromium; however, since Chromium is now a snap package on Ubuntu, accessing the Jupyter runtime file becomes a problem because of the snap's confinement. So, the other option is to use Firefox instead of Chrome/Chromium.
Firefox, unfortunately, does not have a counterpart of Chrome's -app
option, so there will be a little more work than the Chrome/Chromium solution. This markdown is to document how to use Firefox to accomplish that.
Because Firefox doesn't have a direct counterpart of Chrome's -app
option, we will need to do a couple things on the Firefox side.
Open Firefox profile manager using one of the following methods:
- run
firefox -ProfileManager
in a terminal - open Firefox and type
about:profiles
in the address bar
Here, my new profile is named web-app. Then launch a new Firefox instance using the new profile.
We are going to hide the tool bar and address bar on the Firefox with the new profile. First thing we need to do is to make sure the titlebar is enabled on the new Firefox profile (ie. make sure on the Firefox customize page, the bottom left corner, the Title Bar is toggled on).
You can refer to this post (StackExchange) for the rest of this step. And I will describe the method I used for Firefox Quantum.
- type
about:config
in Firefox address bar - set
toolkit.legacyUserProfileCustomizations.stylesheets
totrue
- go to Firefox profile manager by typing
about:profiles
and open the profile directory for the profile we just created. - create a new file
chrome/userChrome.css
including the parent folder if it doesn't exist. - copy and paste the following content into the
chome/userChrome.css
file/* * Do not remove the @namespace line -- it's required for correct functioning */ @namespace url("http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"); /* set default namespace to XUL */ /* * Hide tab bar, navigation bar and scrollbars * !important may be added to force override, but not necessary * #content is not necessary to hide scroll bars */ #TabsToolbar {visibility: collapse;} #navigator-toolbox {visibility: collapse;} browser {margin-right: -14px; margin-bottom: -14px;}
- Restart Firefox with the new profile, you should see something like this
Generate Jupyter config file if you have never done this before.
jupyter notebook --generate-config
Then copy the profile directory of the new Firefox profile. This can be found on the about:profiles
page.
Then open the config file at .jupyter/jupyter_notebook_config.py
with a text editor. Add this line to the config file
c.LabApp.browser = 'firefox --profile /path/to/profile/directory %s'
where /path/to/profile/directory
should be replaced by the directory of your new Firefox profile.
Save the config file.
Then launch Jupiter lab in terminal jupyter lab
should open a single page firefox instance with JupyterLab.