Chromium è un browser web grafico di Google, bastato sul motore di rendering WebKit.
- 1 Installazione
- 2 Configurazione
- 3 Tips and tricks
- 3.1 Controlling Memory Usage
- 3.2 Link file manager to "Show in folder" function
- 3.3 Icons not shown in download tab
- 3.4 Cache in tmpfs
- 3.5 Profile in tmpfs
- 3.6 Enabling experimental features
- 3.7 Search Engines
- 4 Troubleshooting
- 5 Resources
La versione stabile di Chromium può essere installata dal repository ufficiale con:
# pacman -S chromium
Esiste anche una versione in via di sviluppo che può essere trovata in Arch User Repository sotto il nome di Template:Package AUR, oltre a Template:Package AUR che è uno script di aggiornamento che installa o aggiorna alle nightly build di Chromium. Una versione in binario è Template:Package AUR.
Esistono anche alcuni pacchetti in AUR che forniscono la versione in binario di Google Chrome.
Si veda anche questo articolo per una spiegazione delle differenze tra i tre flavour, Chromium vs. Chrome, e i numeri di versione.
Visualizzare vari caratteri non latini
Per visualizzare correttamente caratteri cinesi, giapponesi e coreani, si veda qui per istruzioni dettagliate per installare i vari font TrueType.
Usare Chromium senza ambiente desktop
A differenza di Firefox, Chromium non mantiene un proprio database di mimetype-to-application associations. Invece, si affida a Template:Filename (parte di extra/xdg-utils) per aprire file e, per esempio, magnet link.
In un ambiente desktop (es. Gnome, o Kde, or Xfce), Template:Filename passa semplicemente gli argomenti all'applicazione che apre i file di quell'ambiente desktop (rispettivamente Template:Filename, Template:Filename, o Template:Filename), e ciò significa che le associazioni sono lasciate all'ambiente desktop.
Comunque, quando non vengono rilevati ambienti desktop (per esempio quando viene eseguito un window manager standalone, come Openbox), il comportamento diTemplate:Filename diventa piuttosto strano e irritante: molti tipi di file aperti negli stessi Firefox o Chromium, nessun supporto per magnet link, etc.
Ci sono molte soluzioni a questo problema, delineate qui sotto.
- Improve xdg-open, make it smarter (aka "patches welcome" :P )
- Use part of a desktop environment, specifically, the part which includes the file opener; for gnome, that would be 'libgnome' (and its dependencies), for xfce, 'exo'. The $DE environment variable needs to be exported before starting the window manager. For example:
- Use Template:Package AUR (written by an arch (trusted) user) and Template:Package AUR, which replaces extra/xdg-utils and contains a Template:Filename script patched to make use of Template:Filename the same way Template:Filename would be used. Mimetype<->application associations can then be customised easily in Template:Filename or Template:Filename
- Use pcmanfm file associations (eg. for lxde desktop enviroment users). Change:
- When using openbox and no Desktop Environment (=DE) like KDE, GNOME or XFCE do following:
Attention: Do not export any DE environment variable!
Then, you basically have to fill the Template:Filename file with default associations. As this can be painful, some utilities are available:
- xdg-mime: not that intuitive; e.g. to use xpdf as default pdf viewer:
$ xdg-mime default xpdf.desktop application/pdf
- mimetype (Template:Package Official package): more intuitive; e.g. to select default application for a given extension (you need a sample file):
$ mimetype -d file.extension
This should create an entry in your local mime database: Template:File Restart chromium and your pdf files should be opened with xpdf now.
For me it only worked as normal user - as root I had problems cause no directories for the local mime times were created. See also this thread.
You could also try installing Template:Package Official
Resa dei font
Si suppone che Chromium usi ora le impostazioni in Template:Filename, sebbene potrebbero essere state modificate manualmente (si veda come configurare i font). Se i font sono ancora resi malamente è possibile usare le impostazioni xft come suggerito qui. Si crei Template:Filename qualora non esista e si aggiunga:
! Xft settings --------------------------------------------------------------- Xft.dpi: 96 Xft.antialias: true Xft.rgba: rgb Xft.hinting: true Xft.hintstyle: hintslight
if [ -n "$DISPLAY" ]; then BROWSER=chromium fi
The other way is to edit the xdg-open script.
$ sudo $YOUR_EDITOR /usr/bin/xdg-open
At almost the bottom on the file, is a long horizontal list of browsers:
if [ x"$DE" = x"" ]; then # if BROWSER variable is not set, check some well known browsers instead if [ x"$BROWSER" = x"" ]; then BROWSER=links2:links:lynx:w3m if [ -n "$DISPLAY" ]; then BROWSER=firefox:mozilla:epiphany:konqueror:chromium-browser:google-chrome:$BROWSER fi fi DE=generic fi
Add chromium: (mind the colon which separates the entries) before firefox:mozilla: ... and save. To test if this were conducted successfully, type this into your terminal:
$ xdg-open http://google.com
If everything went perfect, 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 mimeo, is to associate "http://" links with chromium: Template:File
If running i686 Arch Linux, all one needs to do is to install the flash plugin and restart chromium:
# pacman -S flashplugin
For x86_64, one needs to enable the new [multilib] repository.
# pacman -S flashplugin
Open PDF files inside Chromium
There are two ways to do this: The first one by using Google Chrome's own PDF rendering plugin, the second by allowing Chromium access to e. g. Adobe Reader via the mozplugger plugin. KDE users can also choose KParts Plugin and use any installed KDE application as an embedded viewer.
libpdf is Google's own implementation of a PDF renderer. While compatible, it is currently only part of Chrome releases, not Chromium ones.
The easiest way to add it to the latter is using one of the packages provided in the AUR — Template:Package AUR for the stable version of the browser, or for the dev version either Template:Package AUR if your Chromium package installed to Template:Filename or Template:Package AUR if it installed to Template:Filename.
To do it manually, download a Google Chrome release that corresponds to the version of Chromium you use:
$ wget https://dl-ssl.google.com/linux/direct/google-chrome-stable_current_i386.deb $ wget https://dl-ssl.google.com/linux/direct/google-chrome-unstable_current_i386.deb
$ wget https://dl-ssl.google.com/linux/direct/google-chrome-stable_current_amd64.deb $ wget https://dl-ssl.google.com/linux/direct/google-chrome-unstable_current_amd64.deb
Extract the deb file with
$ ar vx <deb-file>
Extract LZMA archive with
$ tar -xJf <lzma-file>
Move Template:Filename from Template:Filename to the appropriate directory as stated above. A change of its file permissions and ownership may be necessary (the permission of Template:Filename should be 755).
Start Chromium and open about:plugins. "Chrome PDF Viewer" should now view; it may need to be enabled.
To use KParts Plugin, install Template:Package AUR from AUR. The plugin should be able, among other things, to open PDF files inside Chromium using an embedded Okular instance.
Chromium uses NSS for the certificate management. Certificates can be managed (including added) by going to Wrench -> Preferences -> Under the Hood -> Manage Certificates.
Tips and tricks
Controlling Memory Usage
- Chromium offers some command-line options to help control how efficient it is with system memory, by determining how often it should release memory back to the operating system. It is done with the flag --memory-model=X, where X is either high, medium, or low. Setting it to high makes chromium never release memory. Medium makes it reduce its working set of the memory when switching tabs, and low makes it reduce its working set when switching tabs and when the browser is not actively being used. In my experience, running chromium with --memory-model=low can actually improve performance as well, though your mileage may vary. --Falcata 06:07, 26 November 2010 (EST)
Link file manager to "Show in folder" function
When you are using a window manager such as Openbox in combination with a file manager like Thunar instead of a DE, this function of Chromium may only show the directory tree inside Chromium. However to show the file in the folder using your file manager instead, install Template:Filename.
Icons not shown in download tab
You may find that Chromium shows icon placeholders (icons representing broken documents) instead of appropriate icons in its download tab. The likely cause is that you have not installed a desktop environment.
Remedy this by installing GNOME icons:
# pacman -S gnome-icon-theme
Cache in tmpfs
For SSD users, it is nice to have the cache of Chromium in a tmpfs, but there is no need to have the whole profile in a tmpfs (see below). Someone posted here a solution for this.
Close Chromium before starting! Replace your_user with your username.
Add the following to Template:Filename:
cache-chromium /home/your_user/.cache/chromium tmpfs defaults,noatime,mode=1777 0 0
Then delete & recreate the cache folder of Chromium:
rm -r /home/your_user/.cache/chromium mkdir /home/your_user/.cache/chromium
Restart your machine or do sudo mount -a
Afterwards, Chromium's cache should be in RAM. You can check that with df -h.
There is also a command line parameter for placing the cache somewhere else:
This could be another solution, if Template:Filename is in RAM for example.
Profile in tmpfs
The default Chromium profile is located in Template:Filename. This profile can be relocated to an available tmpfs filesystem, including Template:Filename, or Template:Filename for improvements in application response as the the entire profile is now stored in RAM. Another benefit is a reduction in disk read and write operations, of which SSDs benefit the most.
Simple bash script to automate the process
Use the following Bash script to automatically move your Chromium profile to Template:Filename and keep it synchronized.
#!/bin/bash STATIC=$HOME/.config/chromium-backup LINK=$HOME/.config/chromium VOLATILE=/dev/shm/.chromium [[ ! -d $VOLATILE/cache ]] && mkdir -p $VOLATILE/cache [[ ! -h $HOME/.cache/chromium ]] && ln -s $VOLATILE/cache $HOME/.cache/chromium [[ -r $VOLATILE ]] || install -dm755 $VOLATILE if [[ `readlink $LINK` != $VOLATILE ]]; then mv $LINK $STATIC ln -s $VOLATILE $LINK fi if [[ -e $LINK/.flagged ]]; then rsync -a --delete --exclude .flagged $LINK/ $STATIC/ else rsync -a $STATIC/ $LINK/ touch $LINK/.flagged fi
Do not forget to make it executable:
$ chmod +x $HOME/bin/sync-chromium
Call the script at login by copying the following to your Template:Filename
[Desktop Entry] Type=Application Exec=$HOME/bin/sync-chromium Hidden=false Name=ff-sync
Add a cron job to keep it updated
$ crontab -e
Add a line to start the script every 30 minutes,
*/30 * * * * ~/bin/sync-chromium
or add the following to do so every 2 hours:
0 */2 * * * ~/bin/sync-chromium
Add an entry to Template:Filename
Finally, a line to Template:Filename will keep your profile synchronized when the machine is shutdown.
# echo "su user -c /home/user/bin/sync-chromium" >> /etc/rc.local.shutdown
Enabling experimental features
To enable experimental features of Chromium like WebGL and rendering webpages with the GPU, type "about:flags" in the Chromium address bar and enable features you want.
You can make sites like wiki.archlinux.org and wikipedia.org easily searchable by first executing a search on those pages, then going to Options>Preferences>Basics and clicking "Manage" in the "Default Search" section. You can then, for example, "Edit" the Wikipedia entry and change its keyword to "w". Then, you can search Wikipedia for "Arch Linux" from the address bar by simply entering "w arch linux". "?" is a hard-coded keyword for Google search (it will behave differently from the other keywords). It allows you to easily search for things like "/bin/bash".
If you cannot get your default profile when you try to run chromium:
$ chromium [2630:2630:485325611:FATAL:chrome/browser/browser_main.cc(755)] Check failed: profile. Cannot get default profile. Trace/breakpoint trap
Just correct the owner of the directory Template:Filename, and it will work.
$sudo chown -R yourusername:yourusergroup /home/yourusername/.config/chromium