Chromium
zh-CN:ChromiumTemplate:Article summary start Template:Article summary text Template:Article summary heading Template:Article summary wiki Template:Article summary wiki Template:Article summary wiki Template:Article summary wiki Template:Article summary end Chromium is an open source graphical web browser from Google, based on the WebKit rendering engine.
Contents
Installation
The open source project, Chromium, can be installed with the package chromium, available in the official repositories. In the AUR you can also find:
- chromium-devAUR - the development version
- chromium-browser-binAUR - the binary version of the latest Chromium build
The modified browser, Google Chrome, bundled with Flash Player and PDF Reader, can be installed with the package google-chromeAUR, available in the AUR. In the AUR you can also find:
- google-chrome-betaAUR - the beta version
- google-chrome-devAUR - the development version
SRWare Iron, a modified Chromium with altered settings to increase privacy and with built-in ad-blocker, can be installed with the package iron-binAUR, available in the AUR.
Configuration
File associations
Unlike Firefox, Chromium does not maintain its own database of mimetype-to-application associations. Instead, it relies on xdg-open to open files and other mime types and URI schemes, for example, magnet links. There are exceptions to this rule though, for example in the case of mailto URIs, Chromium calls xdg-email
, which is also part of xdg-utils package.
Refer to xdg-open, default applications or environment variables on how to set up default file associations.
Default browser
The simplest way to make Chromium the default browser is to set the BROWSER
environment variable:
~/.profile
if [ -n "$DISPLAY" ]; then BROWSER=chromium fi
To test if this was applied successfully, try to open an URL with xdg-open
as follows:
$ xdg-open http://google.com/
If everything went well, either a new tab inside Chromium, or a new window would open and display the Google homepage, depending on your settings.
Another option, when using mimeoAUR, is to associate http://
links with Chromium:
~/.config/mimeo.conf
/usr/bin/chromium ^http://
If all of that still does not get it working, you can try the following:
~/.local/share/applications/mimeapps.list
[Added Associations] [...] x-scheme-handler/http=chromium.desktop [Default Applications] [...]
If even that didn't work, try this:
$ xdg-mime default chromium.desktop x-scheme-handler/http $ xdg-mime default chromium.desktop x-scheme-handler/https
For more info, see Xdg-open.
Font rendering
Chromium is now supposed to use the settings in ~/fontconfig/fonts.conf
. For possibly better rendering you may try:
~/fontconfig/fonts.conf
<match target="font"> <edit name="autohint" mode="assign"> <bool>true</bool> </edit> <edit name="hinting" mode="assign"> <bool>true</bool> </edit> <edit mode="assign" name="hintstyle"> <const>hintslight</const> </edit> </match>
If the fonts are still rendered badly, you can use Xft settings as suggested here:
~/.Xresources
[...] ! Xft settings --------------------------------------------------------------- Xft.dpi: 96 Xft.antialias: true Xft.rgba: rgb Xft.hinting: true Xft.hintstyle: hintslight [...]
Then update the X Resources database using:
$ xrdb -merge ~/.Xresources
Non-Latin characters
Install needed fonts to correctly display Chinese, Japanese, Korean characters. For examples of recommended fonts for various languages see Font Packages.
For the Arch Wiki, one only needs the ttf-arphic-uming package.
Flash Player plugin
Adobe (Netscape plugin API)
The Adobe Flash plugin can be installed with the package flashplugin, available in the official repositories.
Adobe (Pepper plugin API)
While the classic Flash plugin will not be updated for Linux, an updated Flash Player is included with Google Chrome. It is compatible with Chromium and Iron.
The easiest way to install pepper-flash for Chromium is using one of the packages provided in the AUR:
- chromium-pepper-flash-stableAUR for the stable version.
- chromium-pepper-flashAUR for a development version.
Enable the Flash Player plugin with location /usr/lib/PepperFlash/libpepflashplayer.so
in chrome://plugins
and disable the plugin with location /usr/lib/mozilla/plugins/libflashplayer.so
.
libflashplayer.so
and start it with:
$ iron --ppapi-flash-path=/usr/lib/PepperFlash/libpepflashplayer.so --ppapi-flash-version=11.9.900.117
PDF viewer plugin
There are multiple ways of enabling PDF support in Chromium that are detailed below.
libpdf
libpdf is Google's own implementation of a PDF renderer included with Google Chrome. It is compatible with Chromium and Iron.
The easiest way to install libpdf for Chromium is using one of the packages provided in the AUR:
- chromium-libpdf-stableAUR for the stable version.
- chromium-libpdfAUR for a development version.
Enable the plugin in chrome://plugins
.
libpdf.so
into correct path. For example, to install it for chromium-browser-binAUR, replace
install -m644 opt/google/chrome/libpdf.so "${pkgdir}/usr/lib/chromium"
with
install -m644 opt/google/chrome/libpdf.so "${pkgdir}/opt/chromium-browser"
Manual installation
To do it manually, download a Google Chrome release that corresponds to the version of Chromium you use:
$ curl -O https://dl-ssl.google.com/linux/direct/google-chrome-stable_current_i386.deb $ curl -O https://dl-ssl.google.com/linux/direct/google-chrome-unstable_current_i386.deb $ curl -O https://dl-ssl.google.com/linux/direct/google-chrome-stable_current_amd64.deb $ curl -O https://dl-ssl.google.com/linux/direct/google-chrome-unstable_current_amd64.deb
Extract the deb file with:
$ ar vx deb-file
Extract LZMA the archive with:
$ tar -xJf lzma-file
Move libpdf.so
from opt/google/chrome/
to the appropriate directory as stated above. A change of its file permissions and ownership may be necessary (the permission of libpdf.so
should be 755).
To verify that the installation went correctly: start Chromium, open chrome://plugins/
and check if "Chrome PDF Viewer" is available (it may need to be enabled).
libpdf.so
, it may become incompatible. Thus and with respect to possible security fixes it is advisable to update both at the same time.Using mozplugger
Using the KParts plugin
Certificates
Chromium uses NSS for the certificate management. Certificates can be managed in Settings
→ Show advanced settings...
→ Manage Certificates...
.
Tips and tricks
Troubleshooting
Proxy settings
There have been many situations in which proxy settings do not work properly, especially if set through the KDE interface. A good method as of now is to use Chromium's command-line options, like --proxy-pac-url
and --proxy-server
, to set your proxy.
Default profile
If you cannot get your default profile when you try to run Chromium and get a similar error instead:
$ chromium
[2630:2630:485325611:FATAL:chrome/browser/browser_main.cc(755)] Check failed: profile. Cannot get default profile. Trace/breakpoint trap
You have to set the correct owner of the directory ~/.config/chromium
as following:
# chown -R yourusername:yourusergroup ~/.config/chromium
WebGL
Sometimes, Chromium will disable WebGL with certain graphics card configurations. This can generally be remedied by typing about:flags
into the URL bar and enabling the WebGL flag. You may also enable WebGL by passing the command line flag --enable-webgl
to Chromium in the terminal.
There is also the possibility that your graphics card has been blacklisted by Chromium. To override this use the --ignore-gpu-blacklist
flag or go to about:flags
and enable Override software rendering list
.
Google Play and Flash
DRM content on Flash still requires HAL to play. This is readily apparent with Google Play Movies. If one attempts to play a Google Play movie without HAL, they will receive a YouTube-like screen, but the video will not play.
As per "Watching movies from Google Play on Arch Linux"; install halAUR and hal-infoAUR. Then remove any previous cache files for Flash:
$ rm -rf ~/.adobe/Flash_Player/*
Start the HAL daemon and one will be able to watch Google Play Movie content.
# systemctl start hal
Alternately one can just save the following Bash script below and run it before they want to watch Google Play Movie content.
script
#!/bin/bash ## written by Mark Lee <bluerider> ## using information from <https://wiki.archlinux.org/index.php/Chromium#Google_Play_.26_Flash> ## Start and stop HAL service on command for Google Play Movie service function main () { ## run the main insertion function clear-cache; ## remove adobe cache start-hal; ## start the hal daemon read -p "Press 'enter' to stop hal"; ## pause the command line with a read line stop-hal; ## stop the hal daemon } function clear-cache () { ## remove adobe cache cd ~/.adobe/Flash_Player; ## go to Flash player user directory rm -rf NativeCache AssetCache APSPrivateData2; ## remove cache } function start-hal () { ## start the hal daemon sudo systemctl start hal && ( ## systemd : start hal daemon echo "Started HAL service..." ) || ( echo "Failed to start HAL service!" ) } function stop-hal () { ## stop the hal daemon sudo systemctl stop hal && ( ## systemd : stop HAL daemon echo "Stopped HAL service..." ) || ( echo "Failed to stop HAL service!" ) } main; ## run the main insertion function
Force 3D acceleration in Pepper Flash Player and i.g. the browser with radeon driver
To force 3D rendering there is an option "Override software rendering list" in chrome://flags
, also you would have to export video acceleration variables, see ATI#Enabling_video_acceleration. You could check if it is working in chrome://gpu
.