Chromium

From Gentoo Wiki
Jump to:navigation Jump to:search
This page is a translated version of the page Chromium and the translation is 96% complete.
Other languages:
English • ‎中文(中国大陆)‎ • ‎日本語

Chromium 是Google Chrome 网络浏览器的开源版本。 它具有最小的用户界面、强大的网络开发工具和内置的任务管理器。 Chromium 项目处于实施新 Web 标准的最前沿。

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 and the integration of Adobe's Flash Player. A complete list of the differences can be found in the chromium repository.

安装

USE 标记

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

component-build Split build into more shared libraries to speed up linking. Mostly intended for debugging and development, NOT RECOMMENDED for general use.
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.
hangouts Enable support for Google Hangouts features such as screen sharing
headless Build Ozone only with headless backend, NOT RECOMMENDED for general use.
js-type-check Enable JavaScript type-checking for Chrome's web technology-based UI. Requires Java.
kerberos Add kerberos support
official Enable Official build instead of Developer build.
pic Disable optimized assembly code that is not PIC friendly
proprietary-codecs Enable codecs for patent-encumbered audio and video formats.
pulseaudio Add support for PulseAudio sound server
screencast Enable support for remote desktop and screen cast using media-video/pipewire
selinux !!internal use only!! Security Enhanced Linux support, this must be set by the selinux profile or breakage will occur
suid Build the SUID sandbox, which is only needed on CONFIG_USER_NS=n kernels
system-ffmpeg Use system ffmpeg instead of the bundled one
system-harfbuzz Use system harfbuzz instead of the bundled one.
system-icu Use system icu instead of the bundled one
system-png Use system libpng 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
为了避免与 dev-libs/libxml2 的安装版本发生冲突,从而阻止 Chromium 的安装,必须在 /etc/portage/make.conf 中设置 icu USE 标志。如果 icu 是新设置的,在安装 Chromium 之前需要更新系统,执行:

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

l10n (语言)

Chromium 中的 USE_EXPAND 有许多可用的语言。事实上,它们多到维基无法显示所有。要获得完整的语言列表,请运行:

user $equery u www-client/chromium | grep l10n
Note
equery 工具是 app-portage/gentoolkit 软件包的一部分。需要安装它才能使用上述命令。

有关本地化的更多信息,请参阅 本地化文章

Emerge

Tip
请注意,编译 Chromium 会占用大量时间、CPU 时间和系统内存。每个 make 线程允许 2Gb 的 RAM(由 MAKEOPTS 定义,请参阅 这篇文章)。在系统负载较重的情况下构建 Chromium 可能不是一个好主意。

根据需要设置 USE 标志后,使用以下命令 emerge Chromium:

root #emerge --ask www-client/chromium

配置

HiDPI

Chromium 的视觉输出通常不与 Desktop environment 的 DPI 缩放关联。可以使用 --force-device-scale-factor 命令行选项指示它以缩放模式启动。此选项可以传递一个整数或十进制值。标准缩放从 1.0 开始。例如,要将 Chromium 的 UI 放大 1.5 倍:

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

可以在 此处 找到命令行开关的完整列表。

本地 Wayland 支持

从版本 87 开始,可以通过传递以下 选项 来启用 Chromium 中的原生 Wayland 支持:

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

要将 Chromium 设置为每次使用 Wayland 后端启动,请在用户的 Chromium 配置文件中附加以下几行:

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

禁用标签悬停卡

从版本 91.0.4472.77 开始,不再可能在 Chrome 标志中禁用标签悬停卡。 Google 也似乎没有优先考虑重新添加此功能。为了禁用它们,你可以将此补丁添加到 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 59e2d1e1fc..d94947109c 100644
--- a/chrome/browser/ui/views/tabs/tab_strip.cc
+++ b/chrome/browser/ui/views/tabs/tab_strip.cc
@@ -2119,6 +2119,7 @@ void TabStrip::OnMouseEventInTab(views::View* source,
 }
 
 void TabStrip::UpdateHoverCard(Tab* tab, HoverCardUpdateType update_type) {
+  return;
   // We don't want to show a hover card while the tabstrip is animating.
   if (bounds_animator_.IsAnimating()) {
     // Once we're animating the hover card should already be hidden.

另请参阅 添加标签悬停卡的设置

使用

Chrome 网址

与 Firefox 非常相似,Chromium 有许多内部 Chrome 网址(特殊页面),用于额外配置、故障排除、任务管理等。可以通过导航到以下位置访问特殊页面的详尽列表:chrome://about/

突出的特殊页面包括:

  • 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.

故障排除

标签页崩溃

Chromium 中的标签页偶尔会崩溃。这可能由很多原因引起,但最常见的原因之一是系统内存不足。在 Gentoo 上,如果系统正在编译更新 www-client/chromium同时运行 Chromium,这种情况大概率会发生。

free 命令可用于查看系统上有多少可用内存:

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

解决方案是释放内存,直到大的包编译完成。打开资源监视器并关闭占用大量内存的应用程序。

另请参阅

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

参考