Chromium: Difference between revisions

From ArchWiki
(Undo revision 496317 by Orschiro (talk) - this issue is only about GNOME keyring, other password stores are mentioned in Chromium/Tips_and_tricks#Force_a_password_store)
m (→‎Hardware video acceleration: expand useless acronym)
 
(299 intermediate revisions by 92 users not shown)
Line 1: Line 1:
[[Category:Web browser]]
[[Category:Web browser]]
[[Category:Google]]
[[de:Chromium]]
[[de:Chromium]]
[[es:Chromium]]
[[fr:chromium]]
[[it:Chromium]]
[[ja:Chromium]]
[[ja:Chromium]]
[[ru:Chromium]]
[[zh-hans:Chromium]]
[[zh-hans:Chromium]]
{{Related articles start}}
{{Related articles start}}
{{Related|Chromium/Tips and tricks}}
{{Related|Browser extensions}}
{{Related|Browser plugins}}
{{Related|Firefox}}
{{Related|Firefox}}
{{Related|Opera}}
{{Related|Vivaldi}}
{{Related articles end}}
{{Related articles end}}


[[Wikipedia:Chromium (web browser)|Chromium]] is an open-source graphical web browser based on the [[Wikipedia:Blink (web engine)|Blink]] rendering engine. It is the basis for the proprietary Google Chrome browser.
[[Wikipedia:Chromium (web browser)|Chromium]] is an open-source graphical web browser based on the [[Wikipedia:Blink (web engine)|Blink]] rendering engine. It is the basis for the proprietary Google Chrome browser.


== Installation ==
See [https://chromium.googlesource.com/chromium/src/+/master/docs/chromium_browser_vs_google_chrome.md this page] for an explanation of the differences between Chromium and Google Chrome. Additionally:


The open-source project, '''Chromium''', can be [[install]]ed with the {{Pkg|chromium}} package. For printing support, see [[Gtk#Printers not shown in the GTK print dialog]].
* Sync is unavailable in Chromium 89+ (2021-03-02) [https://archlinux.org/news/chromium-losing-sync-support-in-early-march/]


Other alternatives include:
{{Note|Sync can be temporarily restored by [https://gist.github.com/foutrelis/14e339596b89813aa9c37fd1b4e5d9d5 using Chrome's OAuth2 credentials] or [https://www.chromium.org/developers/how-tos/api-keys getting your own], but pay attention to the disclaimers and do not consider this to be a long-term solution.
Consider switching to [https://www.xbrowsersync.org xbrowsersync] for bookmarks syncing as long term solution.
}}


* {{App|Chromium Beta Channel|the beta version|https://googlechromereleases.blogspot.com/|{{AUR?|chromium-beta}}}}
See [[List of applications/Internet#Blink-based]] for other browsers based on Chromium.
* {{App|Chromium Dev Channel|the development version|https://googlechromereleases.blogspot.com/|{{AUR|chromium-dev}}}}
* {{App|Chromium snapshot builds|the untested nightly version|https://build.chromium.org/|{{AUR|chromium-snapshot-bin}}}}
* {{App|Chromium with [[VA-API]] support|with a patch to enable VA-API|https://chromium-review.googlesource.com/c/chromium/src/+/532294|{{AUR|chromium-vaapi}}}}


The derived browser, '''Google Chrome''', which automatically installs Flash Player and Widevine [[Wikipedia:Encrypted Media Extensions|EME]] (for e.g. Netflix), can be [[install]]ed with the {{AUR|google-chrome}} package.
== Installation ==


Other alternatives include:
There are several packages available to [[install]] Chromium with:


* {{App|Google Chrome Beta Channel|the beta version|https://www.google.com/chrome/browser/beta.html|{{AUR|google-chrome-beta}}}}
* {{Pkg|chromium}} — stable release;
* {{App|Google Chrome Dev Channel|the development version|https://www.google.com/chrome/browser/|{{AUR|google-chrome-dev}}}}
* {{AUR|chromium-dev}} — development release;
* {{AUR|chromium-snapshot-bin}} — nightly build.


{{Note|Support for native client (NaCl) has been dropped in {{pkg|chromium}} version 54, see {{Bug|51511}}. Opening NaCl applications will display this error message: "This plugin is not supported". The {{aur|google-chrome}} package supports NaCl.}}
Google Chrome packages:


See these [https://chromium.googlesource.com/chromium/src/+/master/docs/chromium_browser_vs_google_chrome.md two] [https://www.howtogeek.com/202825/what%E2%80%99s-the-difference-between-chromium-and-chrome/ articles] for an explanation of the differences between Chromium and Chrome.
* {{AUR|google-chrome}} — stable release;
* {{AUR|google-chrome-beta}} — beta release;
* {{AUR|google-chrome-dev}} — development release.


On top of the different Chromium build channels, a number of forks exist with more or less special features; see [[List of applications#Blink-based]].
{{Note|From the [https://www.chromium.org/Home/chromium-privacy Chromium privacy page]: "Features that communicate with Google made available through the compilation of code in Chromium are subject to the [https://www.google.com/policies/privacy/ Google Privacy Policy]." For those who want to avoid all integration with Google services, there are some [[List of applications/Internet#Privacy-focused chromium spin-offs|privacy-focused spin-offs]].}}


== Configuration ==
== Configuration ==
{{Merge|Chromium#Tips and tricks 2|Most of the content in this section should be split between [[Chromium#Tips and tricks 2]] and maybe [[Chromium#Troubleshooting]] for the applicable sections.}}


=== Default applications ===
=== Default applications ===
Line 46: Line 46:
To set Chromium as the default browser and to change which applications Chromium launches when opening downloaded files, see [[default applications]].
To set Chromium as the default browser and to change which applications Chromium launches when opening downloaded files, see [[default applications]].


=== Flash Player plugin ===
=== Certificates ===
 
Chromium uses [[Network Security Services]] for certificate management. Certificates can be managed in {{ic|chrome://settings/certificates}}.
 
=== Making flags persistent ===
 
{{Note|The {{ic|chromium-flags.conf}} file and the accompanying custom launcher script are specific to the various Chromium packages. For Google Chrome, use {{ic|chrome-flags.conf}} (or {{ic|chrome-''channel''-flags.conf}} for the Dev and Beta channels) instead.}}
 
You can put your flags in a {{ic|chromium-flags.conf}} file under {{ic|$HOME/.config/}} (or under {{ic|$XDG_CONFIG_HOME}} if you have configured that environment variable) or {{ic|/etc/}} for global.
 
No special syntax is used; flags are defined as if they were written in a terminal.
 
* The arguments are split on whitespace and shell quoting rules apply, but no further parsing is performed.
* In case of improper quoting anywhere in the file, a fatal error is raised.
* Flags can be placed in separate lines for readability, but this is not required.
* Lines starting with a hash symbol (#) are skipped. (This is only supported by the Chromium launcher script and will not work when using Google Chrome.)


Flash Player is automatically installed when using Google Chrome.
Below is an example {{ic|chromium-flags.conf}} file that defines the flags {{ic|--start-maximized --incognito}}:


To install it for Chromium, [[install]] the {{Pkg|pepper-flash}} package.
{{hc|~/.config/chromium-flags.conf|
# This line will be ignored.
--start-maximized
--incognito
}}


Make sure Flash is allowed to run in {{ic|chrome://settings/content/flash}}.
=== Force GPU acceleration ===


=== Widevine Content Decryption Module plugin ===
Since at least Chromium 110, GPU acceleration is enabled by default for most systems. You may have to [[append]] the following flags to [[/Tips and tricks#Making flags persistent|persistent configuration]] if your system configuration is matched by the [https://chromium.googlesource.com/chromium/src/gpu/+/master/config/software_rendering_list.json block list]:


Widevine is Google's Encrypted Media Extensions (EME) Content Decryption Module (CDM). It is used to watch premium video content such as Netflix. It is automatically installed when using Google Chrome.
{{Warning|Disabling the rendering blocklist may cause unstable behavior, including crashes of the host. See the bug reports in {{ic|chrome://gpu}} for details.}}


To install it for Chromium, [[install]] the {{AUR|chromium-widevine}} package. Make sure ''Allow sites to play protected content'' is checked in {{ic|chrome://settings/content/protectedContent}}.
{{hc|~/.config/chromium-flags.conf|
--ignore-gpu-blocklist
--enable-zero-copy
}}
 
=== Hardware video acceleration ===
{{Note|1=<nowiki/>
* There is no official support from Chromium or Arch Linux for this feature [https://chromium.googlesource.com/chromium/src/+/master/docs/gpu/vaapi.md#vaapi-on-linux]. However, {{Pkg|chromium}} from official repositories is compiled with VA-API support and you may ask for help in [https://bbs.archlinux.org/viewtopic.php?id=244031 the dedicated forum thread].
* Since Chromium version 122, the {{AUR|chromium-wayland-vaapi}} package is no longer needed. VA-API works when using the native Wayland backend with the {{Pkg|chromium}} package from official repositories.
* On AMD GPU devices, VA-API does not work according to [https://bugs.chromium.org/p/chromium/issues/detail?id=1445074&q=VAAPI&can=2 Chromium bug 1445074]. It's been [https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26165 fixed] in time for mesa 24.1, but it only works under X11/XWayland (flag {{ic|1=--ozone-platform-hint=x11}}) and it requires additional flags (check the merge request).
}}
If you've confirmed working VA-API support by checking the output of {{ic|1=vainfo}} (see [[Hardware video acceleration#Verifying VA-API]]), you might first try the following flag alone:
{{hc|~/.config/chromium-flags.conf|
--enable-features{{=}}VaapiVideoDecodeLinuxGL
}}
otherwise, continue reading.
 
To enable VA-API support in Chromium:
 
* Install the correct VA-API driver for your video card and verify VA-API has been enabled and working correctly, see [[Hardware video acceleration]]. For proprietary NVIDIA support, installing {{AUR|libva-vdpau-driver-chromium}}{{Broken package link|package not found}} or {{AUR|libva-vdpau-driver-vp9-git}} is required.
* Set the option {{ic|1=--enable-features=VaapiVideoDecoder}}. This is enough when using ANGLE GL renderer and {{Pkg|libva-intel-driver}}.
* When using ANGLE, Chromium forces the older i965 driver and fails when {{Pkg|intel-media-driver}} is used. As a workaround, [[Hardware video acceleration#Configuring VA-API|configure VA-API manually]]. See [https://github.com/intel/media-driver/issues/818] for details.
* To use the system GL renderer on Xorg or Wayland, use {{ic|1=--use-gl=egl}}. Setting this option might no longer be needed when using Chrome 112 and may break GPU acceleration when using AMD GPUs.
* If VA-API still does not work, try the {{ic|1=--enable-features=VaapiIgnoreDriverChecks}} or{{ic|1=--disable-features=UseChromeOSDirectVideoDecoder}} flag
* If VA-API still does not work on X11 and old GPUs, set the {{ic|1=LIBVA_DRI3_DISABLE=1}} [[environment variable]] [https://www.phoronix.com/news/VA-API-libva-2.18].
 
==== Tips and tricks ====
 
To check if it is working play a video which is using a codec supported by your VA-API driver (''vainfo'' tells you which codecs are supported, but Chromium will only support VP9 and h264):
 
* Open the DevTools by pressing {{ic|Ctrl+Shift+I}} or on the ''Inspect'' button of the context (right-click) menu
* Add the Media inspection tab: ''Hamburger menu > More tools > Media''
* In the newly opened Media tab, look at the hardware decoder state of the video decoder
 
Test on a large enough video. Starting with version 86, Chromium on desktop [https://bugs.chromium.org/p/chromium/issues/detail?id=684792 will only accelerate videos larger than 720p].
 
To reduce CPU usage while watching YouTube where VP8/VP9 hardware decoding is not available use the [https://chrome.google.com/webstore/detail/h264ify/aleakchihdccplidncghkekgioiakgal h264ify], [https://chrome.google.com/webstore/detail/enhanced-h264ify/omkfmpieigblcllmkgbflkikinpkodlk enhanced-h264ify] or [https://chrome.google.com/webstore/detail/not-yet-av1/dcmllfkiihingappljlkffafnlhdpbai Not yet, AV1][https://bbs.archlinux.org/viewtopic.php?pid=2039884#p2039884] extension.
 
On some systems (especially on Xwayland) you might need to [[#Force GPU acceleration]]. Only {{ic|--ignore-gpu-blocklist}} is enough for our purposes.
 
{{Expansion|Provide a link to some bug report.}}
 
You might need to disable the Skia renderer, as it is currently not compatible with video decode acceleration: {{ic|1=--disable-features=UseSkiaRenderer}}
 
=== KDE integration ===
 
For integration into [[Plasma]] install {{Pkg|plasma-browser-integration}}. See [https://community.kde.org/Plasma/Browser_Integration KDE Plasma Browser Integration] for more details.


=== PDF viewer plugin ===
=== PDF viewer plugin ===


Chromium and Google Chrome are bundled with the ''Chromium PDF Viewer'' plugin. If you don't want to use this plugin, check ''Open PDFs using a different application'' in {{ic|chrome://settings/content/pdfDocuments}}.
Chromium and Google Chrome are bundled with the ''Chromium PDF Viewer'' plugin. If you do not want to use this plugin, check ''Download PDFs'' in {{ic|chrome://settings/content/pdfDocuments}}.
 
=== Running on Xwayland ===
 
If you are using NVIDIA's proprietary driver, running Chromium on Xwayland may cause the GPU process to occasionally crash. To prevent the GPU process from crashing, add the following flags:


=== Certificates ===
--use-angle=vulkan --use-cmd-decoder=passthrough
 
{{Note|This does not prevent all Xwayland-related crashes.}}
 
=== Native Wayland support ===
 
Since version 97, native [[Wayland]] support in Chromium can be enabled with the following flags [https://chromium.googlesource.com/chromium/src/+/43cfb2f92a5cdc1a787d7326e74676884abf5052]:
 
--ozone-platform-hint=auto
 
If this doesn't work, e.g. on version 106 under [[Weston]], then use:
 
--ozone-platform=wayland
 
See [[#Making flags persistent]] for a permanent configuration. The flag is also available via [[#chrome:// URLs|browser flags menu]].
 
This will select wayland Ozone backend when in wayland session, so you can use a single desktop entry if you switch between X11 and Wayland often.
 
{{Note|When changing the "ozone-platform-hint" in browser flags menu, the browser will provide you a relaunch button. Do not use it, because the browser will still be relaunched in a platform it was before changing the flag. You need to close the browser, then open it.}}
 
Additionally, if you are having [https://bugs.chromium.org/p/chromium/issues/detail?id=1422087 trouble with input methods] you may also want to force newer GTK:
 
--gtk-version=4
 
==== Touchpad Gestures for Navigation ====
 
To enable two finger swipe to go back and forward through your history, use the following flags:


Chromium uses [[Network Security Services|NSS]] for certificate management. Certificates can be managed in {{ic|chrome://settings/certificates}}.
--ozone-platform-hint=auto --enable-features=TouchpadOverscrollHistoryNavigation


== Tips and tricks ==
== Tips and tricks ==


See the main article: [[Chromium/Tips and tricks]].
The following tips and tricks should work for both Chromium and Chrome unless explicitly stated.
 
=== Browsing experience ===
 
==== chrome:// URLs ====
 
A number of tweaks can be accessed via Chrome URLs. See '''chrome://chrome-urls''' for a complete list.
 
* '''chrome://flags''' - access experimental features such as WebGL and rendering webpages with GPU, etc.
* '''chrome://extensions''' - view, enable and disable the currently used Chromium extensions.
* '''chrome://gpu''' - status of different GPU options.
* '''chrome://sandbox''' - indicate sandbox status.
* '''chrome://version''' - display version and switches used to invoke the active {{ic|/usr/bin/chromium}}.
 
An automatically updated, complete listing of Chromium switches (command line parameters) is available [https://peter.sh/experiments/chromium-command-line-switches/ here].
 
==== Chromium task manager ====
 
Shift+ESC can be used to bring up the browser task manager wherein memory, CPU, and network usage can be viewed.
 
==== Chromium overrides/overwrites Preferences file ====
 
If you enabled syncing with a Google Account, then Chromium will override any direct edits to the Preferences file found under {{ic|~/.config/chromium/Default/Preferences}}. To work around this, start Chromium with the {{ic|--disable-sync-preferences}} switch:
$ chromium --disable-sync-preferences
 
If Chromium is started in the background when you login in to your desktop environment, make sure the command your desktop environment uses is:
$ chromium --disable-sync-preferences --no-startup-window
 
==== Search engines ====
 
Make sites like [https://wiki.archlinux.org wiki.archlinux.org] and [https://en.wikipedia.org wikipedia.org] easily searchable by first executing a search on those pages, then going to ''Settings > Search'' and click the ''Manage search engines..'' button. From there, "Edit" the Wikipedia entry and change its keyword to '''w''' (or some other shortcut you prefer). Now searching Wikipedia for "Arch Linux" from the address bar is done simply by entering "'''w arch linux'''".
 
{{Note| Google search is used automatically when typing something into the URL bar. A hard-coded keyword trigger is also available using the '''?''' prefix.}}
 
==== Tmpfs ====
 
===== Cache in tmpfs =====
 
{{Note|Chromium stores its cache separate from its browser profile directory.}}
 
To limit Chromium from writing its cache to a physical disk, one can define an alternative location via the {{ic|--disk-cache-dir}} flag:
 
$ chromium --disk-cache-dir="$XDG_RUNTIME_DIR/chromium-cache"
 
Cache should be considered temporary and will '''not''' be saved after a reboot or hard lock. Another option is to setup the space in {{ic|/etc/fstab}}:
 
{{hc|/etc/fstab|2=
tmpfs /home/''username''/.cache tmpfs noatime,nodev,nosuid,size=400M 0 0
}}
 
Alternatively create a symbolic link to {{ic|/tmp}}. Make sure to delete Chromium's cache folder before you run the command:
 
$ ln -s /tmp /home/''username''/.cache/chromium
 
===== Profile in tmpfs =====
 
Relocate the browser profile to a [[Wikipedia:Tmpfs|tmpfs]] filesystem, including {{ic|/tmp}}, or {{ic|/dev/shm}} for improvements in application response as the entire profile is now stored in RAM.
 
Use an active profile management tool such as {{Pkg|profile-sync-daemon}} for maximal reliability and ease of use. It symlinks or bind mounts and syncs the browser profile directories to RAM. For more, see [[Profile-sync-daemon]].
 
==== Launch a new browser instance ====
 
When you launch the browser, it first checks if another instance using the same data directory is already running. If there is one, the new window is associated with the old instance. If you want to launch an independent instance of the browser, you must specify separate directory using the {{ic|--user-data-dir}} parameter:
 
$ chromium --user-data-dir=''/path/to/some/directory''
 
{{Note|The default location of the user data is {{ic|~/.config/chromium/}}.}}
 
==== Directly open *.torrent files and magnet links with a torrent client ====
 
By default, Chromium downloads {{ic|*.torrent}} files directly and you need to click the notification from the bottom-left corner of the screen in order for the file to be opened with your default torrent client. This can be avoided with the following method:
 
* Download a {{ic|*.torrent}} file.
* Right-click the notification displayed at the bottom-left corner of the screen.
* Check the "''Always Open Files of This Type''" checkbox.
 
See [[xdg-open]] to change the default assocation.
 
==== Touch Scrolling on touchscreen devices ====
 
You may need to specify which touch device to use. Find your touchscreen device with {{ic| xinput list}} then launch Chromium with the {{ic|1=--touch-devices='''x'''}} parameter, where "'''x'''" is the id of your device. {{Note|If the device is designated as a slave pointer, using this may not work, use the master pointer's ID instead.}}
 
==== Reduce memory usage ====
 
By default, Chromium uses a separate OS process for each ''instance'' of a visited web site. [https://www.chromium.org/developers/design-documents/process-models#Supported_Models] However, you can specify command-line switches when starting Chromium to modify this behaviour.
 
For example, to share one process for all instances of a website:
 
$ chromium --process-per-site
 
To use a single process model:
 
$ chromium --single-process
 
{{Warning|The single-process model is discouraged because it is unsafe and may contain bugs not present in other models.[https://www.chromium.org/developers/design-documents/process-models#TOC-Single-process]}}
 
In addition, you can suspend or store inactive Tabs with extensions such as [https://chrome.google.com/webstore/detail/tab-suspender/fiabciakcmgepblmdkmemdbbkilneeeh?hl=en Tab Suspender] and [https://chrome.google.com/webstore/detail/onetab/chphlpgkkbolifaimnlloiipkdnihall?hl=en OneTab].
 
==== User Agent ====
 
The User Agent can be arbitrarily modified at the start of Chromium's base instance via its {{Ic|<nowiki>--user-agent="[string]"</nowiki>}} parameter.
 
==== DOM Distiller ====
 
Chromium has a similar reader mode to Firefox. In this case it is called DOM Distiller, which is an [https://github.com/chromium/dom-distiller open source project].
It is disabled by default, but can be enabled using the {{Ic|chrome://flags/#enable-reader-mode}} flag, which you can also make [[#Making flags persistent|persistent]].
Not only does DOM Distiller provide a better reading experience by distilling the content of the page, it also simplifies pages for print. Even though the latter checkbox option has been removed from the print dialog, you can still print the distilled page, which basically has the same effect.
 
After enabling the flag, you will find a new "Enter reader mode" menu item and corresponding icon in the address bar when Chromium thinks the website you are visiting could do with some distilling.
 
==== Forcing specific GPU ====
 
In multi-GPU systems, Chromium automatically detects which GPU should be used for rendering (discrete or integrated). This works 99% of the time, except when it does not - if an unavailable GPU is picked (for example, discrete graphics on VFIO GPU passthrough-enabled systems), {{ic|chrome://gpu}} will complain about not being able to initialize the GPU process. On the same page below '''Driver Information''' there will be multiple GPUs shown (GPU0, GPU1, ...). There is no way to switch between them in a user-friendly way, but you can read the device/vendor IDs present there and configure Chromium to use a specific GPU with flags:
 
$ chromium --gpu-testing-vendor-id=0x8086 --gpu-testing-device-id=0x1912
 
...where {{ic|0x8086}} and {{ic|0x1912}} is replaced by the IDs of the GPU you want to use (as shown on the {{ic|chrome://gpu}} page).
 
==== Import bookmarks from Firefox ====
 
To ease the transition, you can import bookmarks from [[Firefox]] into Chromium.
 
Navigate Chromium to {{ic|chrome://settings/importData}}
 
If Firefox is already installed on your computer, you can directly import bookmarks as well as many other things from Firefox.
 
Make sure '''Mozilla Firefox''' is selected. Optionally, you can uncheck some unwanted items here. Click the '''Import''' and then '''Done'''. You are done with it.
 
{{note|If you have not created any bookmarks in Chromium yet, the bookmarks will show up in your bookmarks bar. If you already have bookmarks, the bookmarks will be in a new folder labeled "Imported From Firefox"}}
 
If you import bookmarks from another PC, you have to export bookmarks from Firefox first.
 
{{ic|Ctrl+Shift+o}} ''Import and Backup > Export Bookmarks To HTML'' in Firefox.
 
The procedure is pretty much the same. You need to go to {{ic|chrome://settings/importData}}. However, this time, in the '''From''' drop-down menu, select '''Bookmarks HTML File''' and click the '''Choose File''' button and upload the desired bookmark file.
 
==== Enabling native notifications ====
 
Go to {{ic|chrome://flags#enable-system-notifications}} and select ''Enabled''.
 
==== U2F authentication ====
 
Install {{Pkg|libfido2}} library. This provides the udev rules required to enable access to the [[U2F]] key as a user.
U2F keys are by default only accessible by root, and without these rules Chromium will give an error.
 
==== Theming ====
 
You can make Chromium use your current GTK theme for browser menus and controls. Simply press ''Use GTK'' in {{ic|chrome://settings/appearance}}.
 
==== Dark mode ====
 
Since Chromium 114, [[XDG Desktop Portal]] is used to automatically determine the user's preferred appearance ([https://bugs.chromium.org/p/chromium/issues/detail?id=998903 issue]), thereby dissociating dark mode enablement from the user's GTK theme. This preference will be applied to ''prefers-color-scheme'' in CSS, JavaScript, Settings and Dev-Tools.
 
The way to change the preferred appearance depends on your XDG Desktop Portal backend. For instance, many desktop environments have a switch in their appearance settings. Or when using e.g. {{Pkg|xdg-desktop-portal-gtk}}, set the preferred mode to {{ic|prefer-light}}, {{ic|prefer-dark}} or {{ic|default}} with:
 
$ dconf write /org/gnome/desktop/interface/color-scheme \'prefer-dark\'
 
You can query the current preferred appearance using {{ic|dbus-send}} in {{Pkg|dbus}} ([https://flatpak.github.io/xdg-desktop-portal/#gdbus-org.freedesktop.portal.Settings documentation]):
 
$ dbus-send --session --print-reply=literal --dest=org.freedesktop.portal.Desktop /org/freedesktop/portal/desktop org.freedesktop.portal.Settings.Read string:org.freedesktop.appearance string:color-scheme | tr -s ' ' | cut -d ' ' -f 5
 
* '''0''': No preference
* '''1''': Prefer dark appearance
* '''2''': Prefer light appearance
 
===== Pre Chromium 114 =====
 
To enable dark mode and enable the dark theme (normally used for incognito mode) [[append]] the following flag to [[#Making flags persistent|persistent configuration]]:


== Troubleshooting ==
{{hc|1=~/.config/chromium-flags.conf|2=
--force-dark-mode
--enable-features=WebUIDarkMode
}}
 
==== Enable Side Panel ====
 
The Side Panel can be enabled through {{ic|chrome://flags}}. You can enable or disable '''Side panel''', and change options such as '''Side panel border''' and '''Side panel drag and drop'''.
 
=== Profile maintenance ===
 
Chromium uses [[SQLite]] databases to manage history and the like.  Sqlite databases become fragmented over time and empty spaces appear all around. But, since there are no managing processes checking and optimizing the database, these factors eventually result in a performance hit. A good way to improve startup and some other bookmarks- and history-related tasks is to defragment and trim unused space from these databases.
 
{{Pkg|profile-cleaner}} and {{AUR|browser-vacuum}} do just this.
 
=== Security ===
 
==== Disable JIT ====
 
At the cost of reduced performance, you can disable just-in-time compilation of JavaScript to native code, which is responsible for [https://microsoftedge.github.io/edgevr/posts/Super-Duper-Secure-Mode/ roughly half of the security vulnerabilities in the JS engine], using the flag {{ic|1=--js-flags=--jitless}}.
 
==== WebRTC ====
 
WebRTC is a communication protocol that relies on JavaScript that can leak one's actual IP address and hardware hash from behind a VPN. While some software may prevent the leaking scripts from running, it is probably a good idea to block this protocol directly as well, just to be safe. As of October 2016, there is no way to disable WebRTC on Chromium on desktop, there are extensions available to disable local IP address leak, one is this [https://chrome.google.com/webstore/detail/webrtc-network-limiter/npeicpdbkakmehahjeeohfdhnlpdklia extension].
 
One can test WebRTC via https://browserleaks.com/webrtc.
 
{{Warning|Even though IP leak can be prevented, Chromium still sends your unique hash, and there is no way to prevent this. Read more on https://www.browserleaks.com/webrtc#webrtc-disable}}
 
==== SSL certificates ====
 
Chromium does not have an SSL certificate manager.  It relies on the NSS Shared DB {{ic|~/.pki/nssdb}}.  In order to add SSL certificates to the database, users will have to use the shell.
 
===== Adding CAcert certificates for self-signed certificates =====
 
Grab the CAcerts and create an {{ic|nssdb}}, if one does not already exist.  To do this, first install the {{Pkg|nss}} package, then complete these steps:
 
$ mkdir -p $HOME/.pki/nssdb
$ cd $HOME/.pki/nssdb
$ certutil -N -d sql:.
 
$ curl -k -o "cacert-root.crt" "http://www.cacert.org/certs/root.crt"
$ curl -k -o "cacert-class3.crt" "http://www.cacert.org/certs/class3.crt"
$ certutil -d sql:$HOME/.pki/nssdb -A -t TC -n "CAcert.org" -i cacert-root.crt
$ certutil -d sql:$HOME/.pki/nssdb -A -t TC -n "CAcert.org Class 3" -i cacert-class3.crt
 
{{Note|Users will need to create a password for the database, if it does not exist.}}
 
Now users may manually import a self-signed certificate.
 
===== Example 1: Using a shell script to isolate the certificate from TomatoUSB =====
 
Below is a simple script that will extract and add a certificate to the user's {{ic|nssdb}}:
 
#!/bin/sh
#
# usage:  import-cert.sh remote.host.name [port]
#
REMHOST=$1
REMPORT=${2:-443}
exec 6>&1
exec > $REMHOST
echo | openssl s_client -connect ${REMHOST}:${REMPORT} 2>&1 |sed -ne '/-BEGIN CERTIFICATE-/,/-END CERTIFICATE-/p'
certutil -d sql:$HOME/.pki/nssdb -A -t "P,," -n "$REMHOST" -i $REMHOST
exec 1>&6 6>&-
 
Syntax is advertised in the commented lines.
 
References:
*https://web.archive.org/web/20180718193807/https://blog.avirtualhome.com/adding-ssl-certificates-to-google-chrome-linux-ubuntu
*https://chromium.googlesource.com/chromium/src/+/master/docs/linux/cert_management.md
 
===== Example 2: Using Firefox to isolate the certificate from TomatoUSB =====
 
The {{Pkg|firefox}} browser can be used to save the certificate to a file for manual import into the database.
 
Using firefox:
#Browse to the target URL.
#Upon seeing the "This Connection is Untrusted" warning screen, click: ''I understand the Risks > Add Exception...''
#Click: ''View > Details > Export'' and save the certificate to a temporary location ({{ic|/tmp/easy.pem}} in this example).
 
Now import the certificate for use in Chromium:
$ certutil -d sql:$HOME/.pki/nssdb -A -t TC -n "easy" -i /tmp/easy.pem
 
{{Note|Adjust the name to match that of the certificate. In the example above, "easy" is the name of the certificate.}}
 
Reference:
*https://sahissam.blogspot.com/2012/06/new-ssl-certificates-for-tomatousb-and.html
 
==== Canvas Fingerprinting ====
 
Canvas fingerprinting is a technique that allows websites to identify users by detecting differences when rendering to an HTML5 canvas. This information can be made inaccessible by using the {{ic|--disable-reading-from-canvas}} flag.
 
To confirm this is working run [https://panopticlick.eff.org this test] and make sure "hash of canvas fingerprint" is reported as undetermined in the full results.
 
{{Note|1=<nowiki></nowiki>
* Some extensions require reading from canvas and may be broken by setting {{ic|--disable-reading-from-canvas}}.
* YouTube player does not work properly without canvas reading. [https://github.com/qutebrowser/qutebrowser/issues/5345][https://bbs.archlinux.org/viewtopic.php?pid=1907406]
}}
 
==== Privacy extensions ====
 
See [[Browser extensions#Privacy]].
 
{{Tip|Installing too many extensions might take up much space in the toolbar. Those extensions which you would not interact with anyway (e.g. [https://chrome.google.com/webstore/detail/gcbommkclmclpchllfjekcdonpmejbdp HTTPS Everywhere]{{Dead link|2023|04|22|status=404}}) can be hidden by right-clicking on the extension and choosing ''Hide in Chromium menu''.}}
 
==== Do Not Track ====
 
To enable [[wikipedia:Do Not Track|Do Not Track]], visit {{ic|chrome://settings}}, scroll down to ''Advanced'' and under ''Privacy and security'', check ''Send a "Do Not Track" request with your browsing traffic''.
 
==== Force a password store ====
 
Chromium uses a password store to store your passwords and the ''Chromium Safe Storage'' key, which is used to encrypt cookie values. [https://codereview.chromium.org/24734007]
 
By default Chromium auto-detects which password store to use, which can lead to you apparently losing your passwords and cookies when switching to another desktop environment or window manager.


=== Fonts ===
You can force Chromium to use a specific password store by launching it with the {{ic|--password-store}} flag with one of following the values [https://chromium.googlesource.com/chromium/src/+/master/docs/linux/password_storage.md]:


{{Note|Chromium does not fully integrate with fontconfig/GTK/Pango/X/etc. due to its sandbox. For more information, see the [https://dev.chromium.org/developers/linux-technical-faq Linux Technical FAQ].}}
* {{ic|gnome-libsecret}}, uses [[Gnome Keyring]] via [https://gitlab.gnome.org/GNOME/libsecret libsecret].
* {{ic|kwallet5}}, uses [[KDE Wallet]]
* {{ic|basic}}, saves the passwords and the cookies' encryption key as plain text in the file {{ic|Login Data}}
* {{ic|detect}}, the default auto-detect behavior


==== Font rendering issues in PDF plugin ====
For example, to force Chromium to use Gnome Keyring in another desktop or WM use {{ic|1=--password-store=gnome-libsecret}}, see [[#Making flags persistent]] for making it permanent.


To fix the font rendering in some PDFs one has to install the {{Pkg|ttf-liberation}} package, otherwise the substituted font causes text to run into other text. This was [https://code.google.com/p/chromium/issues/detail?id=369991 reported on the chromium bug tracker] by an Arch user.
When using a password store of another desktop environment you probably also want to unlock it automatically. See [[GNOME/Keyring#Using the keyring]] and [[KDE Wallet#Unlock KDE Wallet automatically on login]].


=== Force 3D acceleration ===
== Troubleshooting ==


{{Warning|Disabling the rendering blacklist may cause unstable behaviour, including crashes of the host. See the bug reports in {{ic|chrome://gpu}}.}}
=== Fonts ===


First follow [[Hardware video acceleration]]. Then, to force 3D rendering, ''enable'' the flags: "Override software rendering list", "GPU rasterization", "Zero-copy rasterizer" in {{ic|chrome://flags}}. Check if it is working in {{ic|chrome://gpu}}. This may also alleviate tearing issues with the [[radeon]] driver.
{{Note|Chromium does not fully integrate with fontconfig/GTK/Pango/X/etc. due to its sandbox. For more information, see the [https://dev.chromium.org/developers/linux-technical-faq Linux Technical FAQ].}}


If "Native GpuMemoryBuffers" under {{ic|chrome://gpu}} mentions software rendering, you additionally need to pass the {{ic|--enable-native-gpu-memory-buffers}} flag, or some optimizations (like the zero-copy rasterizer) won't do anything. This flag isn't available under {{ic|chrome://flags}} - it must be passed in either the chromium-flags.conf file (as noted in [[Chromium/Tips and tricks#Making flags persistent]]) or directly on the command line.
==== Tab font size is too large ====
 
Chromium will use the GTK settings as described in [[GTK#Configuration]]. When configured, Chromium will use the {{ic|gtk-font-name}} setting for tabs (which may mismatch window font size). To override these settings, use {{ic|1=--force-device-scale-factor=1.0}}.


=== WebGL ===
=== WebGL ===
There is the possibility that your graphics card has been blacklisted by Chromium. See [[#Force 3D acceleration]].
 
There is the possibility that your graphics card has been blacklisted by Chromium. See [[#Force GPU acceleration]].


If you are using Chromium with [[Bumblebee]], WebGL might crash due to GPU sandboxing. In this case, you can disable GPU sandboxing with {{ic|optirun chromium --disable-gpu-sandbox}}.
If you are using Chromium with [[Bumblebee]], WebGL might crash due to GPU sandboxing. In this case, you can disable GPU sandboxing with {{ic|optirun chromium --disable-gpu-sandbox}}.
Line 97: Line 479:
Visit {{ic|chrome://gpu/}} for debugging information about WebGL support.
Visit {{ic|chrome://gpu/}} for debugging information about WebGL support.


Chromium can save incorrect data about your GPU in your user profile (e.g. if you use switch between an Nvidia card using Optimus and Intel, it will show the Nvidia card in {{ic|chrome://gpu}} even when you're not using it or primusrun/optirun). Running using a different user directory, e.g, {{ic|1=chromium --user-data-dir=$(mktemp -d)}} may solve this issue. For a persistent solution you can reset the GPU information by deleting {{ic|~/.config/chromium/Local\ State}}.
Chromium can save incorrect data about your GPU in your user profile (e.g. if you use switch between an Nvidia card using Optimus and Intel, it will show the Nvidia card in {{ic|chrome://gpu}} even when you are not using it or primusrun/optirun). Running using a different user directory, e.g, {{ic|1=chromium --user-data-dir=$(mktemp -d)}} may solve this issue. For a persistent solution you can reset the GPU information by deleting {{ic|~/.config/chromium/Local\ State}}.
 
=== Incorrect HiDPI rendering ===
 
Chromium will automatically scale for a [[HiDPI]] display, however, this may cause an incorrect rendered GUI.


=== Zoomed-in GUI ===
The flag {{ic|1=--force-device-scale-factor=1}} may be used to overrule the automatic scaling factor.


Chromium's graphical interface will automatically scale on high-DPI displays. To disable this, use {{ic|1=--force-device-scale-factor=1}}.
When [[#Native Wayland support|native Wayland support]] is enabled, Chromium will automatically scale based on the configured scale of each monitor.


=== Password prompt on every start with GNOME Keyring ===
=== Password prompt on every start with GNOME Keyring ===
Line 107: Line 493:
See [[GNOME/Keyring#Passwords are not remembered]].
See [[GNOME/Keyring#Passwords are not remembered]].


=== Chromecasts in the network are not discovered ===
=== Everything is syncing except for password ===
 
If synchronization is not working for password only (you can check it on {{ic|chrome://sync-internals/}}) delete profile login data:


You will need to enable the Media Router Component Extension in {{ic|chrome://flags/#load-media-router-component-extension}}.
$ rm ~/.config/chromium/Default/Login\ Data*
 
See [https://support.google.com/chrome/thread/9947763?hl=en&msgid=23687608 Google Chrome Help forum] for details.


=== Losing cookies and passwords when switching between desktop environments ===
=== Losing cookies and passwords when switching between desktop environments ===
Line 115: Line 505:
If you see the message {{ic|Failed to decrypt token for service AccountId-*}} in the terminal when you start Chromium, it might try to use the wrong password storage backend. This might happen when you switch between Desktop Environments.
If you see the message {{ic|Failed to decrypt token for service AccountId-*}} in the terminal when you start Chromium, it might try to use the wrong password storage backend. This might happen when you switch between Desktop Environments.


See [[Chromium/Tips and tricks#Force a password store]].
See [[#Force a password store]].
 
=== Hang on startup when Google Sync enabled ===
 
Try launching Chrome with {{ic|1=--password-store=basic}} or another appropriate password store.
 
See [[#Force a password store]].
 
=== Chromium asks to be set as the default browser every time it starts ===
 
If you are using KDE and have once set Firefox as the default browser (by clicking the button inside Firefox), you might find Chromium asks to be set as the default browser every time it starts, even if you click the "set as default" button.
 
Chromium checks for this status by running {{ic|xdg-settings check default-web-browser chromium.desktop}}. If the output is "no", it is not considering itself to be the default browser. The script {{ic|xdg-settings}} checks for the following MIME associations and expect all of them to be {{ic|chromium.desktop}}:
 
{{bc|
x-scheme-handler/http
x-scheme-handler/https
text/html}}
 
To fix it, go to ''System settings > Applications > Default applications > Web browser'' and choose Chromium. Then, set the MIME association for {{ic|text/html}}:
 
$ xdg-mime default chromium.desktop text/html
 
Finally, [[XDG MIME Applications#New MIME types|update the MIME database]]:
 
$ update-mime-database ~/.local/share/mime
 
=== "This browser or app may not be secure" error logging in to Google ===
 
As of 2020.04.20 if you run chromium with {{ic|1=--remote-debugging-port=9222}} flag for web development, you cannot log in to your Google account. Temporarily disable this flag to login and then you can enable it back.
 
=== Chromium rendering at 60 FPS despite using a display with a higher refresh rate ===
 
Upstream bug report about the general issue which may contain some additional workarounds can be found [https://bugs.chromium.org/p/chromium/issues/detail?id=1200167 here], and a sister issue about mixed refresh rates [https://bugs.chromium.org/p/chromium/issues/detail?id=1138080 here].
 
==== Mixed refresh rates ====
 
{{Tip|This issue is possibly not present on the Wayland backend, needs testing.}}
 
When using displays with mixed refresh rates(for example 60Hz and 144Hz), Chromium might render for the lower Hz display.
 
There is a suitable workaround for this issue, [[append]] the following flags to [[#Making flags persistent|persistent configuration]]:
 
{{hc|1=~/.config/chromium-flags.conf|2=
--use-gl=egl
--ignore-gpu-blocklist
--enable-gpu-rasterization
}}
 
This should make Chromium run at 144 FPS when used on a 144Hz display, assuming your compositor is also refreshing at 144 FPS. 
Keep in mind it might be a little choppy due to {{Bug|67035}}, but it is way better than being stuck at 60 FPS.
 
==== Running on the Wayland backend ====
 
There seem to be Wayland compositor-specific problems that trigger this issue. 
Notably, Plasma 5 seems to only ever render on 60Hz no matter the setup, but Plasma 6(rc1, at the time of writing) makes Chromium work flawlessly on high refresh rates.
 
A workaround may be to switch to the XWayland backend if all else fails.
 
=== Chromium slow scroll speed ===
 
Mouse whell scrolling in chromium and electron based applications may be too slow for daily usage. Here are some solutions.
 
[[Libinput#Mouse wheel scrolling speed scaling]] injects {{ic|libinput_event_pointer_get_axis_value}} function in libinput and provides an interface to change scale factor. This is not a application level injection, so an addition script for application specific scale factor tuning is needed. Note that scroll on chromium's small height developer tools may be too fast when scale factor is big enough.
 
[[IMWheel]] increases scroll distance by replaying X wheel button event for multiple times. However, chromium assumes the real scroll and the replayed ones as two events. There is a small but noticeable delay between them, so one mouse wheel scroll leads to twice page jumps. Also, touchpad scroll needs additional care.
 
[https://chrome.google.com/webstore/detail/linux-scroll-speed-fix/mlboohjioameadaedfjcpemcaangkkbp Linux Scroll Speed Fix] and [https://chrome.google.com/webstore/detail/smoothscroll/nbokbjkabcmbfdlbddjidfmibcpneigj SmoothScroll] are two chromium extensions with suppport for scroll distance modification. Upon wheel scroll in a web page, the closest scrollable ancestor of current focused node will be found, then a scroll method with given pixel distance will be called on it, even if it has been scrolled to bottom. So once you scroll into a text editor or any scrollable element, you can never scroll out of it, except moving mouse. Also, extension based methods can not be used outside chromium.
 
=== Videos load but do not play ===
 
This may be a PulseAudio issue. See the suggested fix in [[PulseAudio/Troubleshooting#Browsers load videos but do no play]].
 
=== Passwords are not saved due to a corrupted database ===
 
The stored password database can become corrupted and in need of getting rebuilt. Doing so will destroy all data therein/lose stored passwords.
 
Launch chromium from a terminal and look for output like:
[472531:472565:1207/055404.688559:ERROR:login_database.cc(1048)] Password decryption failed, encryption_result is 2
 
Exit chromium and then delete these three database files: {{ic|~/.config/chromium/Default/Login Data*}}
 
Launching chromium again should re-create them.
 
=== Cursor is not correct on KDE Wayland ===
 
See [[KDE#Plasma cursor sometimes shown incorrectly]].
 
=== Chromium window is transparent under Wayland ===
 
Due to a [https://issues.chromium.org/issues/329678163 bug], chromium 124 must be started with the explicit command line flag {{ic|1=--ozone-platform=wayland}}.


== See also ==
== See also ==


* [https://www.chromium.org/ Chromium homepage]
* [https://www.chromium.org/ Chromium homepage]
* [https://googlechromereleases.blogspot.com Google Chrome release notes]
* [https://chromereleases.googleblog.com/ Google Chrome release notes]
* [https://chrome.google.com/webstore/category/home Chrome web store]
* [https://chrome.google.com/webstore/ Chrome web store]
* [[Wikipedia:Chromium (web browser)#Differences from Google Chrome|Differences between Chromium and Google Chrome]]
* [[Wikipedia:Chromium (web browser)#Differences from Google Chrome|Differences between Chromium and Google Chrome]]
* [http://peter.sh/experiments/chromium-command-line-switches/ List of Chromium command-line switches]
* [https://peter.sh/experiments/chromium-command-line-switches/ List of Chromium command-line switches]
* [[Profile-sync-daemon]] - Systemd service that saves Chromium profile in tmpfs and syncs to disk
* [[Tmpfs]] - Tmpfs Filesystem in {{ic|/etc/fstab}}
* [https://docs.kernel.org/filesystems/tmpfs.html Official tmpfs kernel Documentation]

Latest revision as of 11:36, 17 April 2024

Chromium is an open-source graphical web browser based on the Blink rendering engine. It is the basis for the proprietary Google Chrome browser.

See this page for an explanation of the differences between Chromium and Google Chrome. Additionally:

  • Sync is unavailable in Chromium 89+ (2021-03-02) [1]
Note: Sync can be temporarily restored by using Chrome's OAuth2 credentials or getting your own, but pay attention to the disclaimers and do not consider this to be a long-term solution.

Consider switching to xbrowsersync for bookmarks syncing as long term solution.

See List of applications/Internet#Blink-based for other browsers based on Chromium.

Installation

There are several packages available to install Chromium with:

Google Chrome packages:

Note: From the Chromium privacy page: "Features that communicate with Google made available through the compilation of code in Chromium are subject to the Google Privacy Policy." For those who want to avoid all integration with Google services, there are some privacy-focused spin-offs.

Configuration

This article or section is a candidate for merging with Chromium#Tips and tricks 2.

Notes: Most of the content in this section should be split between Chromium#Tips and tricks 2 and maybe Chromium#Troubleshooting for the applicable sections. (Discuss in Talk:Chromium)

Default applications

To set Chromium as the default browser and to change which applications Chromium launches when opening downloaded files, see default applications.

Certificates

Chromium uses Network Security Services for certificate management. Certificates can be managed in chrome://settings/certificates.

Making flags persistent

Note: The chromium-flags.conf file and the accompanying custom launcher script are specific to the various Chromium packages. For Google Chrome, use chrome-flags.conf (or chrome-channel-flags.conf for the Dev and Beta channels) instead.

You can put your flags in a chromium-flags.conf file under $HOME/.config/ (or under $XDG_CONFIG_HOME if you have configured that environment variable) or /etc/ for global.

No special syntax is used; flags are defined as if they were written in a terminal.

  • The arguments are split on whitespace and shell quoting rules apply, but no further parsing is performed.
  • In case of improper quoting anywhere in the file, a fatal error is raised.
  • Flags can be placed in separate lines for readability, but this is not required.
  • Lines starting with a hash symbol (#) are skipped. (This is only supported by the Chromium launcher script and will not work when using Google Chrome.)

Below is an example chromium-flags.conf file that defines the flags --start-maximized --incognito:

~/.config/chromium-flags.conf
# This line will be ignored.
--start-maximized
--incognito

Force GPU acceleration

Since at least Chromium 110, GPU acceleration is enabled by default for most systems. You may have to append the following flags to persistent configuration if your system configuration is matched by the block list:

Warning: Disabling the rendering blocklist may cause unstable behavior, including crashes of the host. See the bug reports in chrome://gpu for details.
~/.config/chromium-flags.conf
--ignore-gpu-blocklist
--enable-zero-copy

Hardware video acceleration

Note:
  • There is no official support from Chromium or Arch Linux for this feature [2]. However, chromium from official repositories is compiled with VA-API support and you may ask for help in the dedicated forum thread.
  • Since Chromium version 122, the chromium-wayland-vaapiAUR package is no longer needed. VA-API works when using the native Wayland backend with the chromium package from official repositories.
  • On AMD GPU devices, VA-API does not work according to Chromium bug 1445074. It's been fixed in time for mesa 24.1, but it only works under X11/XWayland (flag --ozone-platform-hint=x11) and it requires additional flags (check the merge request).

If you've confirmed working VA-API support by checking the output of vainfo (see Hardware video acceleration#Verifying VA-API), you might first try the following flag alone:

~/.config/chromium-flags.conf
--enable-features=VaapiVideoDecodeLinuxGL

otherwise, continue reading.

To enable VA-API support in Chromium:

  • Install the correct VA-API driver for your video card and verify VA-API has been enabled and working correctly, see Hardware video acceleration. For proprietary NVIDIA support, installing libva-vdpau-driver-chromiumAUR[broken link: package not found] or libva-vdpau-driver-vp9-gitAUR is required.
  • Set the option --enable-features=VaapiVideoDecoder. This is enough when using ANGLE GL renderer and libva-intel-driver.
  • When using ANGLE, Chromium forces the older i965 driver and fails when intel-media-driver is used. As a workaround, configure VA-API manually. See [3] for details.
  • To use the system GL renderer on Xorg or Wayland, use --use-gl=egl. Setting this option might no longer be needed when using Chrome 112 and may break GPU acceleration when using AMD GPUs.
  • If VA-API still does not work, try the --enable-features=VaapiIgnoreDriverChecks or--disable-features=UseChromeOSDirectVideoDecoder flag
  • If VA-API still does not work on X11 and old GPUs, set the LIBVA_DRI3_DISABLE=1 environment variable [4].

Tips and tricks

To check if it is working play a video which is using a codec supported by your VA-API driver (vainfo tells you which codecs are supported, but Chromium will only support VP9 and h264):

  • Open the DevTools by pressing Ctrl+Shift+I or on the Inspect button of the context (right-click) menu
  • Add the Media inspection tab: Hamburger menu > More tools > Media
  • In the newly opened Media tab, look at the hardware decoder state of the video decoder

Test on a large enough video. Starting with version 86, Chromium on desktop will only accelerate videos larger than 720p.

To reduce CPU usage while watching YouTube where VP8/VP9 hardware decoding is not available use the h264ify, enhanced-h264ify or Not yet, AV1[5] extension.

On some systems (especially on Xwayland) you might need to #Force GPU acceleration. Only --ignore-gpu-blocklist is enough for our purposes.

This article or section needs expansion.

Reason: Provide a link to some bug report. (Discuss in Talk:Chromium)

You might need to disable the Skia renderer, as it is currently not compatible with video decode acceleration: --disable-features=UseSkiaRenderer

KDE integration

For integration into Plasma install plasma-browser-integration. See KDE Plasma Browser Integration for more details.

PDF viewer plugin

Chromium and Google Chrome are bundled with the Chromium PDF Viewer plugin. If you do not want to use this plugin, check Download PDFs in chrome://settings/content/pdfDocuments.

Running on Xwayland

If you are using NVIDIA's proprietary driver, running Chromium on Xwayland may cause the GPU process to occasionally crash. To prevent the GPU process from crashing, add the following flags:

--use-angle=vulkan --use-cmd-decoder=passthrough
Note: This does not prevent all Xwayland-related crashes.

Native Wayland support

Since version 97, native Wayland support in Chromium can be enabled with the following flags [6]:

--ozone-platform-hint=auto

If this doesn't work, e.g. on version 106 under Weston, then use:

--ozone-platform=wayland

See #Making flags persistent for a permanent configuration. The flag is also available via browser flags menu.

This will select wayland Ozone backend when in wayland session, so you can use a single desktop entry if you switch between X11 and Wayland often.

Note: When changing the "ozone-platform-hint" in browser flags menu, the browser will provide you a relaunch button. Do not use it, because the browser will still be relaunched in a platform it was before changing the flag. You need to close the browser, then open it.

Additionally, if you are having trouble with input methods you may also want to force newer GTK:

--gtk-version=4

Touchpad Gestures for Navigation

To enable two finger swipe to go back and forward through your history, use the following flags:

--ozone-platform-hint=auto --enable-features=TouchpadOverscrollHistoryNavigation

Tips and tricks

The following tips and tricks should work for both Chromium and Chrome unless explicitly stated.

Browsing experience

chrome:// URLs

A number of tweaks can be accessed via Chrome URLs. See chrome://chrome-urls for a complete list.

  • chrome://flags - access experimental features such as WebGL and rendering webpages with GPU, etc.
  • chrome://extensions - view, enable and disable the currently used Chromium extensions.
  • chrome://gpu - status of different GPU options.
  • chrome://sandbox - indicate sandbox status.
  • chrome://version - display version and switches used to invoke the active /usr/bin/chromium.

An automatically updated, complete listing of Chromium switches (command line parameters) is available here.

Chromium task manager

Shift+ESC can be used to bring up the browser task manager wherein memory, CPU, and network usage can be viewed.

Chromium overrides/overwrites Preferences file

If you enabled syncing with a Google Account, then Chromium will override any direct edits to the Preferences file found under ~/.config/chromium/Default/Preferences. To work around this, start Chromium with the --disable-sync-preferences switch:

$ chromium --disable-sync-preferences

If Chromium is started in the background when you login in to your desktop environment, make sure the command your desktop environment uses is:

$ chromium --disable-sync-preferences --no-startup-window

Search engines

Make sites like wiki.archlinux.org and wikipedia.org easily searchable by first executing a search on those pages, then going to Settings > Search and click the Manage search engines.. button. From there, "Edit" the Wikipedia entry and change its keyword to w (or some other shortcut you prefer). Now searching Wikipedia for "Arch Linux" from the address bar is done simply by entering "w arch linux".

Note: Google search is used automatically when typing something into the URL bar. A hard-coded keyword trigger is also available using the ? prefix.

Tmpfs

Cache in tmpfs
Note: Chromium stores its cache separate from its browser profile directory.

To limit Chromium from writing its cache to a physical disk, one can define an alternative location via the --disk-cache-dir flag:

$ chromium --disk-cache-dir="$XDG_RUNTIME_DIR/chromium-cache"

Cache should be considered temporary and will not be saved after a reboot or hard lock. Another option is to setup the space in /etc/fstab:

/etc/fstab
tmpfs	/home/username/.cache	tmpfs	noatime,nodev,nosuid,size=400M	0	0

Alternatively create a symbolic link to /tmp. Make sure to delete Chromium's cache folder before you run the command:

$ ln -s /tmp /home/username/.cache/chromium
Profile in tmpfs

Relocate the browser profile to a tmpfs filesystem, including /tmp, or /dev/shm for improvements in application response as the entire profile is now stored in RAM.

Use an active profile management tool such as profile-sync-daemon for maximal reliability and ease of use. It symlinks or bind mounts and syncs the browser profile directories to RAM. For more, see Profile-sync-daemon.

Launch a new browser instance

When you launch the browser, it first checks if another instance using the same data directory is already running. If there is one, the new window is associated with the old instance. If you want to launch an independent instance of the browser, you must specify separate directory using the --user-data-dir parameter:

$ chromium --user-data-dir=/path/to/some/directory
Note: The default location of the user data is ~/.config/chromium/.

Directly open *.torrent files and magnet links with a torrent client

By default, Chromium downloads *.torrent files directly and you need to click the notification from the bottom-left corner of the screen in order for the file to be opened with your default torrent client. This can be avoided with the following method:

  • Download a *.torrent file.
  • Right-click the notification displayed at the bottom-left corner of the screen.
  • Check the "Always Open Files of This Type" checkbox.

See xdg-open to change the default assocation.

Touch Scrolling on touchscreen devices

You may need to specify which touch device to use. Find your touchscreen device with xinput list then launch Chromium with the --touch-devices=x parameter, where "x" is the id of your device.

Note: If the device is designated as a slave pointer, using this may not work, use the master pointer's ID instead.

Reduce memory usage

By default, Chromium uses a separate OS process for each instance of a visited web site. [7] However, you can specify command-line switches when starting Chromium to modify this behaviour.

For example, to share one process for all instances of a website:

$ chromium --process-per-site

To use a single process model:

$ chromium --single-process
Warning: The single-process model is discouraged because it is unsafe and may contain bugs not present in other models.[8]

In addition, you can suspend or store inactive Tabs with extensions such as Tab Suspender and OneTab.

User Agent

The User Agent can be arbitrarily modified at the start of Chromium's base instance via its --user-agent="[string]" parameter.

DOM Distiller

Chromium has a similar reader mode to Firefox. In this case it is called DOM Distiller, which is an open source project. It is disabled by default, but can be enabled using the chrome://flags/#enable-reader-mode flag, which you can also make persistent. Not only does DOM Distiller provide a better reading experience by distilling the content of the page, it also simplifies pages for print. Even though the latter checkbox option has been removed from the print dialog, you can still print the distilled page, which basically has the same effect.

After enabling the flag, you will find a new "Enter reader mode" menu item and corresponding icon in the address bar when Chromium thinks the website you are visiting could do with some distilling.

Forcing specific GPU

In multi-GPU systems, Chromium automatically detects which GPU should be used for rendering (discrete or integrated). This works 99% of the time, except when it does not - if an unavailable GPU is picked (for example, discrete graphics on VFIO GPU passthrough-enabled systems), chrome://gpu will complain about not being able to initialize the GPU process. On the same page below Driver Information there will be multiple GPUs shown (GPU0, GPU1, ...). There is no way to switch between them in a user-friendly way, but you can read the device/vendor IDs present there and configure Chromium to use a specific GPU with flags:

$ chromium --gpu-testing-vendor-id=0x8086 --gpu-testing-device-id=0x1912

...where 0x8086 and 0x1912 is replaced by the IDs of the GPU you want to use (as shown on the chrome://gpu page).

Import bookmarks from Firefox

To ease the transition, you can import bookmarks from Firefox into Chromium.

Navigate Chromium to chrome://settings/importData

If Firefox is already installed on your computer, you can directly import bookmarks as well as many other things from Firefox.

Make sure Mozilla Firefox is selected. Optionally, you can uncheck some unwanted items here. Click the Import and then Done. You are done with it.

Note: If you have not created any bookmarks in Chromium yet, the bookmarks will show up in your bookmarks bar. If you already have bookmarks, the bookmarks will be in a new folder labeled "Imported From Firefox"

If you import bookmarks from another PC, you have to export bookmarks from Firefox first.

Ctrl+Shift+o Import and Backup > Export Bookmarks To HTML in Firefox.

The procedure is pretty much the same. You need to go to chrome://settings/importData. However, this time, in the From drop-down menu, select Bookmarks HTML File and click the Choose File button and upload the desired bookmark file.

Enabling native notifications

Go to chrome://flags#enable-system-notifications and select Enabled.

U2F authentication

Install libfido2 library. This provides the udev rules required to enable access to the U2F key as a user. U2F keys are by default only accessible by root, and without these rules Chromium will give an error.

Theming

You can make Chromium use your current GTK theme for browser menus and controls. Simply press Use GTK in chrome://settings/appearance.

Dark mode

Since Chromium 114, XDG Desktop Portal is used to automatically determine the user's preferred appearance (issue), thereby dissociating dark mode enablement from the user's GTK theme. This preference will be applied to prefers-color-scheme in CSS, JavaScript, Settings and Dev-Tools.

The way to change the preferred appearance depends on your XDG Desktop Portal backend. For instance, many desktop environments have a switch in their appearance settings. Or when using e.g. xdg-desktop-portal-gtk, set the preferred mode to prefer-light, prefer-dark or default with:

$ dconf write /org/gnome/desktop/interface/color-scheme \'prefer-dark\'

You can query the current preferred appearance using dbus-send in dbus (documentation):

$ dbus-send --session --print-reply=literal --dest=org.freedesktop.portal.Desktop /org/freedesktop/portal/desktop org.freedesktop.portal.Settings.Read string:org.freedesktop.appearance string:color-scheme | tr -s ' ' | cut -d ' ' -f 5
  • 0: No preference
  • 1: Prefer dark appearance
  • 2: Prefer light appearance
Pre Chromium 114

To enable dark mode and enable the dark theme (normally used for incognito mode) append the following flag to persistent configuration:

~/.config/chromium-flags.conf
--force-dark-mode
--enable-features=WebUIDarkMode

Enable Side Panel

The Side Panel can be enabled through chrome://flags. You can enable or disable Side panel, and change options such as Side panel border and Side panel drag and drop.

Profile maintenance

Chromium uses SQLite databases to manage history and the like. Sqlite databases become fragmented over time and empty spaces appear all around. But, since there are no managing processes checking and optimizing the database, these factors eventually result in a performance hit. A good way to improve startup and some other bookmarks- and history-related tasks is to defragment and trim unused space from these databases.

profile-cleaner and browser-vacuumAUR do just this.

Security

Disable JIT

At the cost of reduced performance, you can disable just-in-time compilation of JavaScript to native code, which is responsible for roughly half of the security vulnerabilities in the JS engine, using the flag --js-flags=--jitless.

WebRTC

WebRTC is a communication protocol that relies on JavaScript that can leak one's actual IP address and hardware hash from behind a VPN. While some software may prevent the leaking scripts from running, it is probably a good idea to block this protocol directly as well, just to be safe. As of October 2016, there is no way to disable WebRTC on Chromium on desktop, there are extensions available to disable local IP address leak, one is this extension.

One can test WebRTC via https://browserleaks.com/webrtc.

Warning: Even though IP leak can be prevented, Chromium still sends your unique hash, and there is no way to prevent this. Read more on https://www.browserleaks.com/webrtc#webrtc-disable

SSL certificates

Chromium does not have an SSL certificate manager. It relies on the NSS Shared DB ~/.pki/nssdb. In order to add SSL certificates to the database, users will have to use the shell.

Adding CAcert certificates for self-signed certificates

Grab the CAcerts and create an nssdb, if one does not already exist. To do this, first install the nss package, then complete these steps:

$ mkdir -p $HOME/.pki/nssdb
$ cd $HOME/.pki/nssdb
$ certutil -N -d sql:.
$ curl -k -o "cacert-root.crt" "http://www.cacert.org/certs/root.crt"
$ curl -k -o "cacert-class3.crt" "http://www.cacert.org/certs/class3.crt"
$ certutil -d sql:$HOME/.pki/nssdb -A -t TC -n "CAcert.org" -i cacert-root.crt 
$ certutil -d sql:$HOME/.pki/nssdb -A -t TC -n "CAcert.org Class 3" -i cacert-class3.crt
Note: Users will need to create a password for the database, if it does not exist.

Now users may manually import a self-signed certificate.

Example 1: Using a shell script to isolate the certificate from TomatoUSB

Below is a simple script that will extract and add a certificate to the user's nssdb:

#!/bin/sh
#
# usage:  import-cert.sh remote.host.name [port]
#
REMHOST=$1
REMPORT=${2:-443}
exec 6>&1
exec > $REMHOST
echo | openssl s_client -connect ${REMHOST}:${REMPORT} 2>&1 |sed -ne '/-BEGIN CERTIFICATE-/,/-END CERTIFICATE-/p'
certutil -d sql:$HOME/.pki/nssdb -A -t "P,," -n "$REMHOST" -i $REMHOST 
exec 1>&6 6>&-

Syntax is advertised in the commented lines.

References:

Example 2: Using Firefox to isolate the certificate from TomatoUSB

The firefox browser can be used to save the certificate to a file for manual import into the database.

Using firefox:

  1. Browse to the target URL.
  2. Upon seeing the "This Connection is Untrusted" warning screen, click: I understand the Risks > Add Exception...
  3. Click: View > Details > Export and save the certificate to a temporary location (/tmp/easy.pem in this example).

Now import the certificate for use in Chromium:

$ certutil -d sql:$HOME/.pki/nssdb -A -t TC -n "easy" -i /tmp/easy.pem
Note: Adjust the name to match that of the certificate. In the example above, "easy" is the name of the certificate.

Reference:

Canvas Fingerprinting

Canvas fingerprinting is a technique that allows websites to identify users by detecting differences when rendering to an HTML5 canvas. This information can be made inaccessible by using the --disable-reading-from-canvas flag.

To confirm this is working run this test and make sure "hash of canvas fingerprint" is reported as undetermined in the full results.

Note:
  • Some extensions require reading from canvas and may be broken by setting --disable-reading-from-canvas.
  • YouTube player does not work properly without canvas reading. [9][10]

Privacy extensions

See Browser extensions#Privacy.

Tip: Installing too many extensions might take up much space in the toolbar. Those extensions which you would not interact with anyway (e.g. HTTPS Everywhere[dead link 2023-04-22 ⓘ]) can be hidden by right-clicking on the extension and choosing Hide in Chromium menu.

Do Not Track

To enable Do Not Track, visit chrome://settings, scroll down to Advanced and under Privacy and security, check Send a "Do Not Track" request with your browsing traffic.

Force a password store

Chromium uses a password store to store your passwords and the Chromium Safe Storage key, which is used to encrypt cookie values. [11]

By default Chromium auto-detects which password store to use, which can lead to you apparently losing your passwords and cookies when switching to another desktop environment or window manager.

You can force Chromium to use a specific password store by launching it with the --password-store flag with one of following the values [12]:

  • gnome-libsecret, uses Gnome Keyring via libsecret.
  • kwallet5, uses KDE Wallet
  • basic, saves the passwords and the cookies' encryption key as plain text in the file Login Data
  • detect, the default auto-detect behavior

For example, to force Chromium to use Gnome Keyring in another desktop or WM use --password-store=gnome-libsecret, see #Making flags persistent for making it permanent.

When using a password store of another desktop environment you probably also want to unlock it automatically. See GNOME/Keyring#Using the keyring and KDE Wallet#Unlock KDE Wallet automatically on login.

Troubleshooting

Fonts

Note: Chromium does not fully integrate with fontconfig/GTK/Pango/X/etc. due to its sandbox. For more information, see the Linux Technical FAQ.

Tab font size is too large

Chromium will use the GTK settings as described in GTK#Configuration. When configured, Chromium will use the gtk-font-name setting for tabs (which may mismatch window font size). To override these settings, use --force-device-scale-factor=1.0.

WebGL

There is the possibility that your graphics card has been blacklisted by Chromium. See #Force GPU acceleration.

If you are using Chromium with Bumblebee, WebGL might crash due to GPU sandboxing. In this case, you can disable GPU sandboxing with optirun chromium --disable-gpu-sandbox.

Visit chrome://gpu/ for debugging information about WebGL support.

Chromium can save incorrect data about your GPU in your user profile (e.g. if you use switch between an Nvidia card using Optimus and Intel, it will show the Nvidia card in chrome://gpu even when you are not using it or primusrun/optirun). Running using a different user directory, e.g, chromium --user-data-dir=$(mktemp -d) may solve this issue. For a persistent solution you can reset the GPU information by deleting ~/.config/chromium/Local\ State.

Incorrect HiDPI rendering

Chromium will automatically scale for a HiDPI display, however, this may cause an incorrect rendered GUI.

The flag --force-device-scale-factor=1 may be used to overrule the automatic scaling factor.

When native Wayland support is enabled, Chromium will automatically scale based on the configured scale of each monitor.

Password prompt on every start with GNOME Keyring

See GNOME/Keyring#Passwords are not remembered.

Everything is syncing except for password

If synchronization is not working for password only (you can check it on chrome://sync-internals/) delete profile login data:

$ rm ~/.config/chromium/Default/Login\ Data*

See Google Chrome Help forum for details.

Losing cookies and passwords when switching between desktop environments

If you see the message Failed to decrypt token for service AccountId-* in the terminal when you start Chromium, it might try to use the wrong password storage backend. This might happen when you switch between Desktop Environments.

See #Force a password store.

Hang on startup when Google Sync enabled

Try launching Chrome with --password-store=basic or another appropriate password store.

See #Force a password store.

Chromium asks to be set as the default browser every time it starts

If you are using KDE and have once set Firefox as the default browser (by clicking the button inside Firefox), you might find Chromium asks to be set as the default browser every time it starts, even if you click the "set as default" button.

Chromium checks for this status by running xdg-settings check default-web-browser chromium.desktop. If the output is "no", it is not considering itself to be the default browser. The script xdg-settings checks for the following MIME associations and expect all of them to be chromium.desktop:

x-scheme-handler/http
x-scheme-handler/https
text/html

To fix it, go to System settings > Applications > Default applications > Web browser and choose Chromium. Then, set the MIME association for text/html:

$ xdg-mime default chromium.desktop text/html

Finally, update the MIME database:

$ update-mime-database ~/.local/share/mime

"This browser or app may not be secure" error logging in to Google

As of 2020.04.20 if you run chromium with --remote-debugging-port=9222 flag for web development, you cannot log in to your Google account. Temporarily disable this flag to login and then you can enable it back.

Chromium rendering at 60 FPS despite using a display with a higher refresh rate

Upstream bug report about the general issue which may contain some additional workarounds can be found here, and a sister issue about mixed refresh rates here.

Mixed refresh rates

Tip: This issue is possibly not present on the Wayland backend, needs testing.

When using displays with mixed refresh rates(for example 60Hz and 144Hz), Chromium might render for the lower Hz display.

There is a suitable workaround for this issue, append the following flags to persistent configuration:

~/.config/chromium-flags.conf
--use-gl=egl
--ignore-gpu-blocklist
--enable-gpu-rasterization

This should make Chromium run at 144 FPS when used on a 144Hz display, assuming your compositor is also refreshing at 144 FPS. Keep in mind it might be a little choppy due to FS#67035, but it is way better than being stuck at 60 FPS.

Running on the Wayland backend

There seem to be Wayland compositor-specific problems that trigger this issue. Notably, Plasma 5 seems to only ever render on 60Hz no matter the setup, but Plasma 6(rc1, at the time of writing) makes Chromium work flawlessly on high refresh rates.

A workaround may be to switch to the XWayland backend if all else fails.

Chromium slow scroll speed

Mouse whell scrolling in chromium and electron based applications may be too slow for daily usage. Here are some solutions.

Libinput#Mouse wheel scrolling speed scaling injects libinput_event_pointer_get_axis_value function in libinput and provides an interface to change scale factor. This is not a application level injection, so an addition script for application specific scale factor tuning is needed. Note that scroll on chromium's small height developer tools may be too fast when scale factor is big enough.

IMWheel increases scroll distance by replaying X wheel button event for multiple times. However, chromium assumes the real scroll and the replayed ones as two events. There is a small but noticeable delay between them, so one mouse wheel scroll leads to twice page jumps. Also, touchpad scroll needs additional care.

Linux Scroll Speed Fix and SmoothScroll are two chromium extensions with suppport for scroll distance modification. Upon wheel scroll in a web page, the closest scrollable ancestor of current focused node will be found, then a scroll method with given pixel distance will be called on it, even if it has been scrolled to bottom. So once you scroll into a text editor or any scrollable element, you can never scroll out of it, except moving mouse. Also, extension based methods can not be used outside chromium.

Videos load but do not play

This may be a PulseAudio issue. See the suggested fix in PulseAudio/Troubleshooting#Browsers load videos but do no play.

Passwords are not saved due to a corrupted database

The stored password database can become corrupted and in need of getting rebuilt. Doing so will destroy all data therein/lose stored passwords.

Launch chromium from a terminal and look for output like:

[472531:472565:1207/055404.688559:ERROR:login_database.cc(1048)] Password decryption failed, encryption_result is 2

Exit chromium and then delete these three database files: ~/.config/chromium/Default/Login Data*

Launching chromium again should re-create them.

Cursor is not correct on KDE Wayland

See KDE#Plasma cursor sometimes shown incorrectly.

Chromium window is transparent under Wayland

Due to a bug, chromium 124 must be started with the explicit command line flag --ozone-platform=wayland.

See also