Difference between revisions of "Chromium"

From Gentoo Wiki
Jump to:navigation Jump to:search
m (Updated Hover Card patch example.)
(Improvements to close discussion on associated talk page.)
Line 35: Line 35:
 
}}
 
}}
  
==== l10n (Linguas) ==== <!--T:10-->
+
==== L10N ==== <!--T:10-->
  
 
<!--T:11-->
 
<!--T:11-->
There are many linguas available via <var>USE_EXPAND</var> in Chromium. So many, in fact, that the wiki cannot display all of them. For a full list of linguas run:
+
There are many languages available via the <var>[[:/etc/portage/make.conf#L10N|L10N]]</var> <var>[[USE_EXPAND]]</var> variable in Chromium. So many, in fact, that the wiki cannot display all of them. For a full list of localization languages run:
  
 
<!--T:12-->
 
<!--T:12-->
{{Cmd|equery u www-client/chromium {{!}} grep l10n}}
+
{{Cmd|equery u www-client/chromium {{!}} grep -i l10n}}
  
 
<!--T:13-->
 
<!--T:13-->

Revision as of 00:18, 20 January 2022

Chromium is the open source version of Google's Chrome web browser. It features a minimal user interface, powerful web development tools, and a built in task manager. The Chromium Project is at the forefront of implementing new web standards.

Because Chromium is open source it is legally unable to include several features that the proprietary Google Chrome browser includes by default. Namely automatic updates. A complete list of the differences can be found in the chromium repository.

Installation

USE flags

USE flags for www-client/chromium Open-source version of Google Chrome web browser

X Add support for X11
bindist Flag to enable or disable options for prebuilt (GRP) packages (eg. due to licensing issues)
cups Add support for CUPS (Common Unix Printing System)
custom-cflags Build with user-specified CFLAGS (unsupported)
debug Enable DCHECK feature with severity configurable at runtime. Mostly intended for debugging and development, NOT RECOMMENDED for general use.
ffmpeg-chromium (binpkg only) Use Chromium FFmpeg fork (media-video/ffmpeg-chromium) rather than mainline FFmpeg (media-video/ffmpeg)
gtk4 Build with GTK4 headers.
hangouts Enable support for Google Hangouts features such as screen sharing
headless Build Ozone only with headless backend, NOT RECOMMENDED for general use.
kerberos Add kerberos support
libcxx Use bundled libc++ instead of libstdc++ for building.
lto Build with Link Time Optimizations (via clang's ThinLTO)
official Enable Official build instead of Developer build.
pax-kernel Allow building on a PaX-enabled kernel
pgo Build with Profile Guided Optimizations (2-stage compilation)
proprietary-codecs Enable codecs for patent-encumbered audio and video formats.
pulseaudio Add sound server support via media-libs/libpulse (may be PulseAudio or PipeWire)
qt5 Add support for the Qt 5 application and UI framework
qt6 Add support for the Qt 6 application and UI framework
screencast Enable support for remote desktop and screen cast using PipeWire
selinux !!internal use only!! Security Enhanced Linux support, this must be set by the selinux profile or breakage will occur
system-harfbuzz Use system media-libs/harfbuzz instead of the bundled library.
system-icu Use system dev-libs/icu instead of the bundled one
system-png Use system media-libs/libpng instead of the bundled library
system-toolchain Use system toolchain instead of the bundled one (if possible)
system-zstd Use system app-arch/zstd instead of the bundled one.
vaapi Enable Video Acceleration API for hardware decoding
wayland Enable dev-libs/wayland backend
widevine Unsupported closed-source DRM capability (required by Netflix VOD)

icu

Important
To avoid an emerge slot conflict with dev-libs/libxml2, which prevents Chromium to be emerged, icu USE flag must be set in /etc/portage/make.conf. If icu is newly set, update the system before emerging Chromium by issuing:

root #emerge --ask --update --deep --newuse @world

L10N

There are many languages available via the L10N USE_EXPAND variable in Chromium. So many, in fact, that the wiki cannot display all of them. For a full list of localization languages run:

user $equery u www-client/chromium | grep -i l10n
Note
The equery tools comes as part of the app-portage/gentoolkit package. It will need to be installed in order to use the above command.

For more information on localization see the Localization article.

Emerge

Tip
Be aware that compiling Chromium can take a significant amount of real time, CPU time, and system memory. Allow 2Gb of RAM per each make thread (as defined by MAKEOPTS, see this post). It is probably not a good idea to build Chromium when the system is under heavy load.

After setting USE flags as desired, emerge Chromium with the following command:

root #emerge --ask www-client/chromium

Configuration

Clang

To build Chromium with Clang, first see Clang#Clang_environments.

For Chromium specifically, the following env settings are needed:

FILE /etc/portage/env/clang-chromium
# Optionally, add these to EXTRA_GN:
# - thin_lto_enable_optimizations=true 
# - use_thin_lto=true
# - is_cfi=true 
EXTRA_GN="use_lld=true is_clang=true clang_use_chrome_plugins=false" 

# Needed with GCC 11
CHROMIUM_FORCE_LIBCXX=yes

Then enable it (note that we take the base Clang config from the other article, then add the settings we just defined):

FILE /etc/portage/package.env
# compiler-clang: build with a general Clang environment (see Clang article)
# clang-chromium: build with tweaks specifically for Chromium
www-client/chromium compiler-clang clang-chromium

HiDPI

Chromium's visual output is generally disconnected from a Desktop environment's DPI scaling. It can be instructed to start in a scaled mode by using the --force-device-scale-factor command-line option. This option can be passed a integer or decimal value. Standard scaling begins at 1.0. For example, to make Chromium's UI 1.5x larger:

user $chromium --force-device-scale-factor=1.5

A full list of command-line switches can be found here.

Native Wayland support

Since version 87, native Wayland support in Chromium can be enabled by passing the following options:

user $chromium --enable-features=UseOzonePlatform --ozone-platform=wayland

To set Chromium to start every time using the Wayland backend, append the following lines the user's Chromium configuration file:

FILE ~/.config/chromium-flags.conf
--enable-features=UseOzonePlatform
--ozone-platform=wayland

Disable Tab Hover Cards

Since version 91.0.4472.77 it is no longer possible to disable the Tab Hover Cards within Chrome flags. There seems to be no priority at Google to add this feature back in. In order to disable them, you can add this patch to Portage:

FILE /etc/portage/patches/www-client/chromium/hover-card.patch
diff --git a/chrome/browser/ui/views/tabs/tab_strip.cc b/chrome/browser/ui/views/tabs/tab_strip.cc
index 2c94eb0..1f7bde0 100644
--- a/chrome/browser/ui/views/tabs/tab_strip.cc
+++ b/chrome/browser/ui/views/tabs/tab_strip.cc
@@ -2149,6 +2149,7 @@ void TabStrip::OnMouseEventInTab(views::View* source,
 }
 
 void TabStrip::UpdateHoverCard(Tab* tab, HoverCardUpdateType update_type) {
+  return;
   // Some operations (including e.g. starting a drag) can cause the tab focus
   // to change at the same time as the tabstrip is starting to animate; the
   // hover card should not be visible at this time.

See also Added setting for Tab Hover Cards.

Usage

Chrome URLs

Much like Firefox, Chromium has many internal Chrome URLs (special pages) that are used for additional configuration, troubleshooting, task management, etc. An exhaustive list of special pages can be accessed by navigating to: chrome://about/

Prominent special pages include:

  • chrome://components/ - Shows enabled components and provides a button to check for updates for each of them. It is sometimes necessary to manually update the PPAPI Adobe flash module via this interfaces when using Chrome.
  • chrome://chrome/ - Displays the About page which includes version information.
  • chrome://extensions/ - A page to manage extensions.
  • chrome://flags/ - Enable/disable experimental features.
  • chrome://flash/ - Displays special information about the Adobe Flash Player (if it is accessible by Chromium).
  • chrome://gpu/ - Displays information about use of graphics acceleration.
  • chrome://history/ - Displays web history. Also accessible through the sandwich menu or by pressing Ctrl+h.
  • chrome://memory-redirect/ - Measure the memory usage of the browser and per-tab usage.
  • chrome://net-internals/ - Lots of information on network connections.
  • chrome://plugins/ - Shows a list of plugins. Enable/disable them from this interface. (Deprecated in Chrome version 57[1].)
  • chrome://version/ - Displays more version information than the chrome page.

Troubleshooting

Tabs crash

Occasionally tabs in Chromium crash. This can be caused by quite a few things, however one of the most common reason for occurrence is that the system is running low on memory. On Gentoo, this can especially happen if the system is compiling a www-client/chromium package update while running Chromium.

The free command can be used to see how much memory is available on the system:

user $free -h
              total        used        free      shared  buff/cache   available
Mem:            15G         11G        735M        789M        3.4G        3.1G

The solution to is to free up memory until the large package compiles have finished. Open a resource monitor of choice and kill applications using large amounts of memory.

See also

  • Firefox — Mozilla's web browser.
  • Chrome — Google's proprietary (closed source) web browser.

References