Ubuntu – Chromium snap conversion: Command line options

18.04chromiumsnap

Ubuntu 18.04 allows the system wide definition of command line options that are passed to the Chromium browser provided by the package chromium-browser. The flags are set in the file /etc/chromium-browser/default. Example file content:

# Default settings for chromium-browser. This file is sourced by /bin/sh from
# /usr/bin/chromium-browser

# Options to pass to chromium-browser
CHROMIUM_FLAGS="--disk-cache-dir=/dev/shm"

Where can I set the command line options for the snap version (installed using sudo snap install chromium ) of the Chromium browser?

Best Answer

In the snap version you can set CHROMIUM_FLAGS inside ~/.chromium-browser.init with the same content as /etc/chromium-browser/default

For example

CHROMIUM_FLAGS="--incognito"

Source: https://bugs.launchpad.net/ubuntu/+source/chromium-browser/+bug/1837746

Edit

In addition to the flags, snap application doesn't have access to /dev/shm. Please use one of the following solutions:

  • Install chromium in dev mode snap install chromium --devmode to disable confinement
  • Use /dev/shm/snap.chromium instead of /dev/shm in your flag