Chromium (Italiano)

From ArchWiki
Revision as of 14:18, 1 October 2011 by SirX (Talk | contribs) (kpartsplugin: Paragrafo tradotto)

Jump to: navigation, search

This template has only maintenance purposes. For linking to local translations please use interlanguage links, see Help:i18n#Interlanguage links.


Local languages: Català – Dansk – English – Español – Esperanto – Hrvatski – Indonesia – Italiano – Lietuviškai – Magyar – Nederlands – Norsk Bokmål – Polski – Português – Slovenský – Česky – Ελληνικά – Български – Русский – Српски – Українська – עברית – العربية – ไทย – 日本語 – 正體中文 – 简体中文 – 한국어


External languages (all articles in these languages should be moved to the external wiki): Deutsch – Français – Română – Suomi – Svenska – Tiếng Việt – Türkçe – فارسی

Tango-preferences-desktop-locale.pngThis article or section needs to be translated.Tango-preferences-desktop-locale.png

Notes: please use the first argument of the template to provide more detailed indications. (Discuss in Talk:Chromium (Italiano)#)
Nota: Questo articolo è in fase di traduzione. Seguite per ora le istruzioni della versione inglese.


Chromium è un browser web grafico di Google, bastato sul motore di rendering WebKit.

Installazione

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.

Nota: Compilare chromium-beta o chromium-dev dura all'incirca quanto compilare il kernel Linux.
Nota: chromium-update installa le nightly build di Chromium che sono pre-compilate dal server Chromium Buildbot

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.

Configurazione

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.

  • Ottimizzare xdg-open, rendendolo più svelto (aka "le patch sono benvenute" :P )
  • Usare parti di un ambiente desktop, specificatamente, la parte che include chi apre il file; per GNOME, ciò vorrebbe essere 'libgnome' (e le sue dipendenze), per xfce, 'exo'. La variabile d'ambiente $DE ha bisogno di essere esportata prima di avviare il gestore di finestre. Per esempio:
Template:File
  • Use pcmanfm file associations (eg. for lxde desktop enviroment users). Change:
Template:File
or modify your Template:Filename
Template:File
  • When using openbox and no Desktop Environment (=DE) like KDE, GNOME or XFCE do following:
Template:File

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.

Si potrebbe anche provare ad installare 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
Nota: queste impostazioni riguarderanno ogni applicazione che leggerà Template:Filename, e non solo Cromium; Un esempio è rxvt-unicode.

Browser predefinito

Il modo più semplice per rendere Chromium il browser predefinito è impostare la variabile Template:Codeline in Template:Filename

if [ -n "$DISPLAY" ]; then
     BROWSER=chromium
fi

Un altro modo è modificare lo script xdg-open.

$ sudo $YOUR_EDITOR /usr/bin/xdg-open

Quasi in fondo al file c'è una lunga lista orizzontale di browser:

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

Bisogna aggiungere chromium: (ricordarsi i due punti che separano le voci) prima di firefox:mozilla: ... e salvare. Per privare se questo funziona davvero, inserire in un terminale:

$ xdg-open http://google.com

Se tutto ha funzionato a meraviglia, sarà aperta una nuova tab o una nuova finestra di Chromium con la homepage di Google, dipendente dalle proprie impostazioni.

Un'altra opzione, quando viene usato mimeo, è associare i link "http://" con chromium: Template:File

Se tutto questo non basterà al nostro scopo, è possibile provare ad aggiungere la seguente stringa alla lista Template:Codeline in Template:Filename

x-scheme-handler/http=chromium.desktop

Flash Player

Se si sta usando Arch Linux i686, basta installare il plugin flash e riavviare chromium:

# pacman -S flashplugin

Per x86_64, bisogna abilitare il repository [multilib].

# pacman -S flashplugin

Aprire file PDF in Chromium

Ci sono due modi per farlo: il primo è usando il plugin per la resa dei PDF di Google Chrome, il secondo è consentire a Chromium di accedere, per esempio, ad Adobe Reader attraverso il plugin mozplugger. Gli utenti KDE possono anche scegliere KParts Plugin e usare qualsiasi applicazione KDE installata come visualizzatore incorporato.

libpdf.so

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.

Note: As a new version of Chromium will not update Template:Filename it may become incompatible. Thus and with respect to possible security fixes it is advisable to update both at the same time.

mozplugger

Per usare mozplugger, installare Template:Package AUR da AUR. Seguire le istruzioni simili descritte in Firefox Tweaks per impostare l'applicazione PDF che si vorrebbe usare con mozplugger-chromium.

kpartsplugin

Per usare KParts Plugin, installare Template:Package AUR da AUR. Il plugin dovrebbe essere abilitato, tra le altre cose, per aprire PDF in Chromium usando una sessione incorporata di Okular.

Certificates

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:

--disk-cache-dir=/tmp

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.

Template:Filename:

#!/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

Template:Filename:

[Desktop Entry]
Type=Application
Exec=$HOME/bin/sync-chromium
Hidden=false
Name=ff-sync

Add a cron job to keep it updated

Manipulate the user's cron table using Template:Codeline:

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

Note: Replace the word "user" with the user name of interest in the following line.
# 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.

Search Engines

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

Risoluzione dei problemi

Profilo predefinito

Se non si è in grado di ricevere il proprio profilo predefinito quando si prova ad eseguire chromium:

$ chromium
[2630:2630:485325611:FATAL:chrome/browser/browser_main.cc(755)] Check failed: profile. 
Cannot get default profile. Trace/breakpoint trap

È necessario correggere il proprietario della cartella Template:Filename, e funzionerà.

$sudo chown -R yourusername:yourusergroup /home/yourusername/.config/chromium

Resources