「Chromium 設定」の版間の差分

提供: ArchWiki
ナビゲーションに移動 検索に移動
(同期)
1行目: 1行目:
 
[[Category:ウェブブラウザ]]
 
[[Category:ウェブブラウザ]]
[[en:Chromium tweaks]]
+
[[en:Chromium/Tips and tricks]]
[[zh-CN:Chromium Tips and Tweaks]]
+
[[zh-cn:Chromium/Tips and tricks]]
 
{{Related articles start}}
 
{{Related articles start}}
 
{{Related|Chromium}}
 
{{Related|Chromium}}
 
{{Related|Firefox 設定}}
 
{{Related|Firefox 設定}}
  +
{{Related|Profile-sync-daemon}}
  +
{{Related|Tmpfs}}
 
{{Related articles end}}
 
{{Related articles end}}
   
20行目: 22行目:
   
 
=== ダウンロードタブのアイコンが表示されない ===
 
=== ダウンロードタブのアイコンが表示されない ===
  +
Chromium のダウンロードタブで適当なアイコンの代わりにアイコンのプレースホルダ (壊れたドキュメントを示すアイコン) が表示される場合、おそらく {{Pkg|gnome-icon-theme}} がインストールされていません。
If Chromium shows icon placeholders (icons representing broken documents) instead of appropriate icons in its download tab, the likely cause is that the {{Pkg|gnome-icon-theme}} package is not installed.
 
   
 
=== Chromium が Preferences ファイルを上書きしてしまう ===
 
=== Chromium が Preferences ファイルを上書きしてしまう ===
31行目: 33行目:
   
 
=== 検索エンジン ===
 
=== 検索エンジン ===
Make sites like wiki.archlinux.org and wikipedia.org easily searchable by first executing a search on those pages, then going to ''Settings > Search'' and click the ''Manage search engines..'' button. From there, "Edit" the Wikipedia entry and change its keyword to "w" (or some other shortcut you prefer). Now searching Wikipedia for "Arch Linux" from the address bar is done simply by entering "w arch linux".
+
Make sites like [https://wiki.archlinux.org wiki.archlinux.org] and [https://en.wikipedia.org wikipedia.org] easily searchable by first executing a search on those pages, then going to ''Settings > Search'' and click the ''Manage search engines..'' button. From there, "Edit" the Wikipedia entry and change its keyword to '''w''' (or some other shortcut you prefer). Now searching Wikipedia for "Arch Linux" from the address bar is done simply by entering "'''w arch linux'''".
   
 
{{Note| Google search is used automatically when typing something into the URL bar. A hard-coded keyword trigger is also available using the '''?''' prefix.}}
 
{{Note| Google search is used automatically when typing something into the URL bar. A hard-coded keyword trigger is also available using the '''?''' prefix.}}
42行目: 44行目:
 
$ chromium --disk-cache-dir=/tmp/cache
 
$ chromium --disk-cache-dir=/tmp/cache
   
Cache should be considered temporary and will '''not''' be saved after a reboot or hard lock.
+
Cache should be considered temporary and will '''not''' be saved after a reboot or hard lock. Alternatively, use:
  +
{{hc|/etc/fstab|2=
 
  +
tmpfs /home/''username''/.cache tmpfs
Alternative way, in {{ic|/etc/fstab}}:
 
tmpfs /home/<USER>/.cache tmpfs noatime,nodev,nosuid,size=400M 0 0
+
noatime,nodev,nosuid,size=400M 0 0
  +
}}
   
{{Note|Adjust the size as needed and be careful. If the size is too large and you are using a sync daemon such as [[psd]] on a conventional HDD, it will likely result in very slow start-up times of your graphical system due to long sync back times of the daemon. }}
+
{{Warning|Adjust the size as needed and be careful. If the size is too large and you are using a sync daemon such as [[psd]] on a conventional HDD, it will likely result in very slow start-up times of your graphical system due to long sync back times of the daemon. }}
   
 
==== tmpfs にプロファイル ====
 
==== tmpfs にプロファイル ====
62行目: 65行目:
   
 
{{Note|It won't work if you specify a link or even a symlink to your regular chromium profile (typically {{ic|~/.config/chromium/Default}}). If you want to use the same profile as your current one for this new instance, first copy the folder {{ic|~/.config/chromium/Default}} to a directory of your choice, keeping the same {{ic|Default}} name, and launch the browser using the following command by specifying the parent folder of the {{ic|Default}} folder you have just copied.
 
{{Note|It won't work if you specify a link or even a symlink to your regular chromium profile (typically {{ic|~/.config/chromium/Default}}). If you want to use the same profile as your current one for this new instance, first copy the folder {{ic|~/.config/chromium/Default}} to a directory of your choice, keeping the same {{ic|Default}} name, and launch the browser using the following command by specifying the parent folder of the {{ic|Default}} folder you have just copied.
For example, if you copied the Default folder to {{ic|~/Downloads}}
+
For example, if you copied the Default folder to {{ic|~/Downloads}}: {{ic|1=$ chromium --user-data-dir=~/Downloads}}.
 
{{bc|1=$ chromium --user-data-dir=~/Downloads}}
 
 
}}
 
}}
   
74行目: 75行目:
 
* Check the "Always Open Files of This Type" checkbox.
 
* Check the "Always Open Files of This Type" checkbox.
   
  +
デフォルトの関連付けの変更については [[xdg-open]] を見てください。
For torrent magnet links to open with Deluge automatically when they are clicked, run the following commands:
 
 
{{Note|If you would like to use Transmission instead of Deluge, you can use {{ic|transmission-gtk.desktop}} here instead.}}
 
 
$ gvfs-mime --set x-scheme-handler/magnet deluge.desktop
 
$ xdg-mime default deluge.desktop x-scheme-handler/magnet
 
   
 
=== タッチスクリーンデバイスでタッチスクロール ===
 
=== タッチスクリーンデバイスでタッチスクロール ===
Chrome と Chromium はデフォルトではタッチスクリーンをサポートしていません。chrome の 'flags' から変更できる設定がいくつかあり、あなたの使用しているデバイスで使うことができるかもしれません。公式リポジトリの chromium や AUR の google-chrome でテスト済みです。
+
Chrome と Chromium はデフォルトではタッチスクリーンをサポートしていません。chrome の 'flags' から変更できる設定がいくつかあり、あなたの使用しているデバイスで使うことができるかもしれません。公式リポジトリの {{Pkg|chromium}} や AUR の {{AUR|google-chrome}} でテスト済みです。
 
* Browse to {{ic| chrome://flags}} and set everything to default. (You can skip if you want to)
 
* Switch ''''Enable Touch events'''' to Enabled. {{ic| chrome://flags/#touch-events}}
 
* Switch ''''Touch Scrolling Mode'''' to sync-touchmove. {{ic| chrome://flags/#touch-scrolling-mode }}
 
* Restart chrome and touch scrolling should be working. If it does not, it is worth trying the other modes they have.
 
   
  +
* Browse to '''chrome://flags''' and set everything to default
'''既知のバグ:'''
 
  +
* Switch "''Enable Touch events''" to "''Enabled''" ('''chrome://flags/#touch-events''')
* Touch Scrolling sometimes stops working after resuming from suspend. Restarting the browser seems to fix it.
 
  +
* Restart Chrome and touch scrolling should work. If it does not, it is worth trying the other modes that are available.
* Touching tabs to switch to them is unstable. There is no known fix for this yet.
 
* You may need to specify which touch device to use. Find your touchscreen device with {{ic| xinput list}} then launch Chromium with the {{ic|1=--touch-devices=x}} parameter where x is the id of your device.
+
* You may need to specify which touch device to use. Find your touchscreen device with {{ic| xinput list}} then launch Chromium with the {{ic|1=--touch-devices='''x'''}} parameter, where "'''x'''" is the id of your device. {{Note|If the device is designated as a slave pointer, using this may not work, use the master pointer's ID instead.}}
   
 
=== システムトレイアイコンの無効化 ===
 
=== システムトレイアイコンの無効化 ===
   
Open the URL {{ic|chrome://flags}} in the browser. Disable these flags:
+
ブラウザから {{ic|chrome://flags}} を開いて以下のフラグを無効にしてください:
   
* {{ic|enable-sync-synced-notifications}}
 
* {{ic|enable-google-now}}
 
 
* {{ic|device-discovery-notifications}}
 
* {{ic|device-discovery-notifications}}
* {{ic|enable-experimental-notification-ui}} (Chrome/Chromium 34 only)
 
   
  +
そしてページの下部にある再起動ボタンを押して下さい。
Click the restart button at the bottom of the page.
 
  +
  +
=== メモリの使用量を減らす ===
  +
  +
By default, Chromium uses a separate OS process for each ''instance'' of a visited web site. [https://www.chromium.org/developers/design-documents/process-models#Supported_Models] However, you can specify command-line switches when starting Chromium to modify this behaviour.
  +
  +
For example, to share one process for all instances of a website:
  +
  +
$ chromium --process-per-site
  +
  +
To use a single process model:
  +
  +
$ chromium --single-process
  +
  +
{{Warning|While the single-process model is the default in [[Firefox]] [https://wiki.mozilla.org/Electrolysis] and other browsers, it may contain bugs not present in other models. [https://www.chromium.org/developers/design-documents/process-models#TOC-Single-process]}}
  +
  +
In addition, you can suspend or store inactive Tabs with extensions such as [https://chrome.google.com/webstore/detail/tab-suspender/fiabciakcmgepblmdkmemdbbkilneeeh?hl=en Tab Suspender] and [https://chrome.google.com/webstore/detail/onetab/chphlpgkkbolifaimnlloiipkdnihall?hl=en OneTab].
  +
  +
=== ユーザーエージェント ===
  +
  +
The User Agent can be arbitrarily modified at the start of Chromium's base instance via its {{Ic|<nowiki>--user-agent="[string]"</nowiki>}} parameter.
  +
  +
For the same User Agent as the stable Chrome release for Linux i686 (at the time of writing, the most popular Linux edition of Chrome) one would use:
  +
--user-agent="Mozilla/5.0 (X11; Linux i686) AppleWebKit/535.2 (KHTML, like Gecko) Chrome/20.0.1132.47 Safari/536.11"
  +
  +
An official, automatically updated listing of Chromium releases which also shows the included WebKit version is available as the [https://omahaproxy.appspot.com/ OmahaProxy Viewer].
   
 
==プロファイルのメンテナンス==
 
==プロファイルのメンテナンス==
111行目: 124行目:
   
 
== セキュリティ ==
 
== セキュリティ ==
  +
=== WebRTC ===
=== 安全でない RC4 暗号を無効化 ===
 
  +
WebRTC is a communication protocol that relies on JavaScript that can leak one's actual IP address from behind a VPN. While software like NoScript prevents this, it's probably a good idea to block this protocol directly as well, just to be safe. An [https://code.google.com/p/chromium/issues/detail?id=457492 option to disable it] is available via an [https://chrome.google.com/webstore/detail/webrtc-network-limiter/npeicpdbkakmehahjeeohfdhnlpdklia extension].
   
  +
One can test this via [https://www.privacytools.io/webrtc.html this page].
Since a while RC4 is declared as insecure, but the cipher is still in Chrome present. You should disable the cipher in Chrome. This can be done by starting chrome from the command line with following option:
 
   
  +
=== 安全でない RC4 暗号を無効化 ===
/usr/bin/chromium --cipher-suite-blacklist=0x0001,0x0002,0x0004,0x0005,0x0017,0x0018,0xc002,0xc007,0xc00c,0xc011,0xc016,0xff80,0xff81,0xff82,0xff83
 
   
  +
The RC4 cipher has been [http://www.cisco.com/web/about/security/intelligence/nextgen_crypto.html declared as insecure], but the cipher is still in Chromium at present. To disable it:
You can check for that on https://cc.dcsec.uni-hannover.de/ for the supported list if ciphers. Make sure to test it before and after you make the change.
 
   
  +
$ chromium --cipher-suite-blacklist=0x0001,0x0002,0x0004,0x0005,0x0017,0x0018,0xc002,0xc007,0xc00c,0xc011,0xc016,0xff80,0xff81,0xff82,0xff83
To make the change persistent, you can modify the {{ic|/etc/chromium/default}} and add the line above. To check, open the website mentioned before. A alternative is to grep inside of your process list for the keyword cipher.
 
   
  +
You can check which cipher suites are supported by your browser at https://cc.dcsec.uni-hannover.de/. Make sure to visit this page before and after you make the change to verify that the change was effective.
'''External Information''':
 
   
  +
To make the change persistent, you can modify {{ic|~/.config/chromium-flags.conf}} and add the flags above. To check, open the website mentioned before. An alternative is to grep inside of your process list for the keyword "cipher".
There is no cleaner way to disable. Also the [https://code.google.com/p/chromium/codesearch#chromium/usr/include/nss/sslproto.h source-code] only show the right hexadecimal value for the single cipher.
 
basic information with recommendation to disable RC4 on [https://en.wikipedia.org/wiki/RC4 wikipedia RC4]
 
   
  +
'''参考資料'''
[http://blog.pregos.info/2013/11/13/howto-disable-weak-rc4-cipher-in-firefox-chromium-google-chrome-internet-explorer/comment-page-1/#comment-141763 German Blog] showing to disable RC4 in common browsers.
 
   
  +
There is no cleaner way to disable RC4. Also, the [https://code.google.com/p/chromium/codesearch#chromium/usr/include/nss/sslproto.h source-code] only shows the right hexadecimal value for the single cipher.
===ユーザーエージェント===
 
  +
See [[Wikipedia:RC4]] for basic information and a recommendation to disable RC4.
By default Chromium already sends an excessively detailed User Agent, as is viewable via the EFF's [https://panopticlick.eff.org/ Panopticlick] test. That alone makes each browser readily identifiable with high accuracy — and is further exacerbated by the use of non-stable versions, ones not recently provided by Google's release channels, ones customized e.g. by a distribution.
 
   
  +
[http://blog.pregos.info/2013/11/13/howto-disable-weak-rc4-cipher-in-firefox-chromium-google-chrome-internet-explorer/comment-page-1/#comment-141763 German Blog] showing how to disable RC4 in common browsers.
However, this User Agent can be arbitrarily modified at the start of Chromium's base instance via its {{Ic|<nowiki>--user-agent="[string]"</nowiki>}} parameter.
 
   
  +
===1024ビットの Diffie-Hellman 鍵交換を無効化===
For the same User Agent as the stable Chrome release for Linux i686 (at the time of writing the most popular Linux edition of Chrome) one would use:
 
  +
Following [https://freedom-to-tinker.com/blog/haldermanheninger/how-is-nsa-breaking-so-much-crypto/ recent research] it is likely that the NSA has been breaking 1024-bit Diffie-Hellman for some time now. To disable these [https://www.eff.org/deeplinks/2015/10/how-to-protect-yourself-from-nsa-attacks-1024-bit-DH use]:
--user-agent="Mozilla/5.0 (X11; Linux i686) AppleWebKit/535.2 (KHTML, like Gecko) Chrome/20.0.1132.47 Safari/536.11"
 
   
  +
$ chromium --cipher-suite-blacklist=0x0033,0x0039,0x009E,0xcc15
An official, automatically updated listing of Chromium releases which also shows the included WebKit version is available as the [https://omahaproxy.appspot.com/ OmahaProxy Viewer].
 
  +
  +
(best in combination with disabling RC4, s. a.), restart the browser and check [https://www.howsmyssl.com/ how your SSL is].
   
 
=== SSL 証明書 ===
 
=== SSL 証明書 ===
Chromium doesn't have a SSL certificate manager. It relies on the NSS Shared DB {{ic|~/.pki.nssdb}}. In order to add SSL certificates to the database, users will have to use the shell.
+
Chromium does not have an SSL certificate manager. It relies on the NSS Shared DB {{ic|~/.pki.nssdb}}. In order to add SSL certificates to the database, users will have to use the shell.
   
 
==== 自己署名証明書の CAcert 証明書を追加 ====
 
==== 自己署名証明書の CAcert 証明書を追加 ====
Grab the CAcerts and create a nssdb if one does not already exist. To do this, first install the {{Pkg|nss}} package, then complete these steps:
+
Grab the CAcerts and create an {{ic|nssdb}}, if one does not already exist. To do this, first install the {{Pkg|nss}} package, then complete these steps:
{{bc|<nowiki>[[ ! -e $HOME/.pki/nssdb ]] && mkdir -p $HOME/.pki/nssdb && cd $HOME/.pki/nssdb && certutil -N -d sql:.</nowiki>}}
 
{{Note|Users will need to create a password for the database should it not exist.}}
 
   
  +
$ mkdir -p $HOME/.pki/nssdb
{{bc|<nowiki>curl -k -o "cacert-root.crt" "http://www.cacert.org/certs/root.crt"
 
  +
$ cd $HOME/.pki/nssdb
curl -k -o "cacert-class3.crt" "http://www.cacert.org/certs/class3.crt"
 
certutil -d sql:$HOME/.pki/nssdb -A -t TC -n "CAcert.org" -i cacert-root.crt
+
$ certutil -N -d sql:.
certutil -d sql:$HOME/.pki/nssdb -A -t TC -n "CAcert.org Class 3" -i cacert-class3.crt
 
</nowiki>}}
 
   
  +
$ curl -k -o "cacert-root.crt" "http://www.cacert.org/certs/root.crt"
{{Note|Users will need to create a password for the database should it not exist.}}
 
  +
$ curl -k -o "cacert-class3.crt" "http://www.cacert.org/certs/class3.crt"
  +
$ certutil -d sql:$HOME/.pki/nssdb -A -t TC -n "CAcert.org" -i cacert-root.crt
  +
$ certutil -d sql:$HOME/.pki/nssdb -A -t TC -n "CAcert.org Class 3" -i cacert-class3.crt
  +
  +
{{Note|Users will need to create a password for the database, if it does not exist.}}
   
 
Now users may manually import a self-signed certificate.
 
Now users may manually import a self-signed certificate.
   
  +
==== 例 1: シェルスクリプトを使って TomatoUSB から証明書を分離 ====
==== 例 1: Using a Shell Script Isolate the Certificate from TomatoUSB ====
 
Below is a simple script that will extract and add a certificate to the user's nssdb:
+
Below is a simple script that will extract and add a certificate to the user's {{ic|nssdb}}:
   
 
#!/bin/sh
 
#!/bin/sh
173行目: 189行目:
 
Syntax is advertised in the commented lines.
 
Syntax is advertised in the commented lines.
   
  +
==== 例 2: Firefox を使って TomatoUSB から証明書を分離 ====
Reference:
 
  +
{{Pkg|firefox}} ブラウザを使って証明書をファイルに保存してデータベースに手動でインポートすることができます。
*http://blog.avirtualhome.com/adding-ssl-certificates-to-google-chrome-linux-ubuntu
 
 
==== 例 2: Using Firefox to Isolate the Certificate from TomatoUSB ====
 
The {{Pkg|firefox}} browser can used to save the certificate to a file for manunal import into the DB.
 
   
 
Using firefox:
 
Using firefox:
 
#Browse to the target URL.
 
#Browse to the target URL.
#Upon seeing the "This Connection is Untrusted" warning screen, click I understand the Risks>Add Exception...
+
#Upon seeing the "This Connection is Untrusted" warning screen, click: ''I understand the Risks > Add Exception...''
#Click View>Details>Export and save the certificate to a temporary location ({{ic|/tmp/easy.pem}} in this example).
+
#Click: ''View > Details > Export'' and save the certificate to a temporary location ({{ic|/tmp/easy.pem}} in this example).
   
 
Now import the certificate for use in Chromium:
 
Now import the certificate for use in Chromium:
certutil -d sql:$HOME/.pki/nssdb -A -t TC -n "easy" -i /tmp/easy.pem
+
$ certutil -d sql:$HOME/.pki/nssdb -A -t TC -n "easy" -i /tmp/easy.pem
   
{{Note|Adjust the name to match that of the certificate. In the example above, "easy" is the name on the certificate.}}
+
{{Note|Adjust the name to match that of the certificate. In the example above, "easy" is the name of the certificate.}}
 
Reference:
 
*http://sahissam.blogspot.com/2012/06/new-ssl-certificates-for-tomatousb-and.html
 
   
 
== フラグを永続的に設定 ==
 
== フラグを永続的に設定 ==
  +
{{Note|{{ic|chromium 42.0.2311.90-1}} からユーザー個別のフラグのみがサポートされています。}}
You can export your flags from {{ic|~/.profile}}:
 
export CHROMIUM_USER_FLAGS="--disk-cache-dir=/tmp --disk-cache-size=50000000"
 
   
  +
{{ic|$HOME/.config/}} (あるいは環境変数を設定している場合 {{ic|$XDG_CONFIG_HOME}}) にある {{ic|chromium-flags.conf}} ファイルにフラグを記述できます。
Or add them to {{ic|/etc/chromium/default}}:
 
{{bc|<nowiki>
 
# Default settings for chromium. This file is sourced by /usr/bin/chromium
 
#
 
# Options to pass to chromium
 
CHROMIUM_FLAGS="--scroll-pixels=200"</nowiki>
 
}}
 
   
  +
特殊な構文はありません。ターミナルに書くのと同じようにフラグは定義します。
Chromium will prefer the user defined flags in {{ic|CHROMIUM_USER_FLAGS}} to those defined in {{ic|/etc/chromium/default}}.
 
   
  +
* The arguments are split on whitespace and shell quoting rules apply, but no further parsing is performed.
If you want to use {{ic|CHROMIUM_USER_FLAGS}} and Pepperflash, you should add Chromium Pepperflash arguments to your {{ic|~/.profile}} file.
 
  +
* In case of improper quoting anywhere in the file, a fatal error is raised.
pepperflash_version=`grep -i version /usr/lib/PepperFlash/manifest.json | awk '{print $2}' | awk -F"\"" '{print $2}'`
 
  +
* Flags can be placed in separate lines for readability, but this is not required.
export CHROMIUM_USER_FLAGS="--ppapi-flash-path=/usr/lib/PepperFlash/libpepflashplayer.so --ppapi-flash-version=$pepperflash_version"
 
  +
* Lines starting with a hash symbol (#) are skipped.
  +
  +
以下は {{ic|chromium-flags.conf}} ファイルで {{ic|--start-maximized --incognito}} フラグを定義する例です:
  +
  +
# This line will be ignored.
  +
--start-maximized
  +
--incognito
  +
  +
{{Tip|Pepper Flash をインストールしている場合、ランチャーが自動的に Chromium に適当なフラグを指定するので {{ic|--ppapi-flash-*}} フラグを定義する必要はありません。}}
  +
  +
{{Note|{{ic|chromium-flags.conf}} ファイルは Arch Linux の固有のファイルで {{ic|chromium 42.0.2311.90-1}} で追加されたカスタムランチャースクリプトでサポートされています。}}
   
 
== 参照 ==
 
== 参照 ==
  +
* [[Profile-sync-daemon]] - Systemd service that saves Chromium profile in tmpfs and syncs to disk
 
  +
*http://blog.avirtualhome.com/adding-ssl-certificates-to-google-chrome-linux-ubuntu
* [[Tmpfs#tmpfs|Tmpfs]] - Tmpfs Filesystem in {{ic|/etc/fstab}}
 
  +
*http://sahissam.blogspot.com/2012/06/new-ssl-certificates-for-tomatousb-and.html
* [https://www.kernel.org/doc/Documentation/filesystems/tmpfs.txt Official tmpfs kernel Documentation]
 

2016年1月12日 (火) 19:07時点における版

関連記事

ブラウズのエクスペリエンス

chrome://xxx

URL フィールドに chrome://xxx と入力することで様々な設定にアクセスすることができます。完全なリストは URL フィールドに chrome://chrome-urls と入力することで見ることが可能です。以下有名な URL のリスト:

  • chrome://flags - WebGL などの実験的な機能や GPU によるウェブページのレンダリングなどにアクセスできます。
  • chrome://plugins - 現在使用している Chromium プラグインを表示・有効化・無効化。
  • chrome://gpu - 様々な GPU オプションの状態。
  • chrome://sandbox - indicate sandbox status.
  • chrome://version - display version and switches used to invoke the active /usr/bin/chromium.

An automatically updated, complete listing of Chromium switches is available here.

ダウンロードタブのアイコンが表示されない

Chromium のダウンロードタブで適当なアイコンの代わりにアイコンのプレースホルダ (壊れたドキュメントを示すアイコン) が表示される場合、おそらく gnome-icon-theme がインストールされていません。

Chromium が Preferences ファイルを上書きしてしまう

Google アカウントの同期を有効にしている場合、$HOME/.config/chromium/Default/Preferences 下の Preferences ファイルに直接編集を加えていても Chromium によって上書きされてしまいます。上書きされないようにするには、--disable-sync-preferences スイッチを付けて Chromium を起動してください:

$ chromium --disable-sync-preferences

If Chromium is started in the background when you login in to your desktop environment, make sure the command your desktop environment uses is

$ chromium --disable-sync-preferences --no-startup-window

検索エンジン

Make sites like wiki.archlinux.org and wikipedia.org easily searchable by first executing a search on those pages, then going to Settings > Search and click the Manage search engines.. button. From there, "Edit" the Wikipedia entry and change its keyword to w (or some other shortcut you prefer). Now searching Wikipedia for "Arch Linux" from the address bar is done simply by entering "w arch linux".

ノート: Google search is used automatically when typing something into the URL bar. A hard-coded keyword trigger is also available using the ? prefix.

Tmpfs

tmpfs にキャッシュ

ノート: Chromium actually keeps its cache directory separate from its browser profile directory.

To limit Chromium from writing its cache to a physical disk, one can define an alternative location via the --disk-cache-dir=/foo/bar flag:

$ chromium --disk-cache-dir=/tmp/cache

Cache should be considered temporary and will not be saved after a reboot or hard lock. Alternatively, use:

/etc/fstab
tmpfs /home/username/.cache tmpfs
noatime,nodev,nosuid,size=400M 0 0
警告: Adjust the size as needed and be careful. If the size is too large and you are using a sync daemon such as psd on a conventional HDD, it will likely result in very slow start-up times of your graphical system due to long sync back times of the daemon.

tmpfs にプロファイル

Relocate the browser profile to a tmpfs filesystem, including /tmp, or /dev/shm for improvements in application response as the entire profile is now stored in RAM.

Use an active profile management script for maximal reliability and ease of use.

profile-sync-daemonAUR is such a script and is directly available from the AUR. It symlinks and syncs the browser profile directories to RAM. Refer to the Profile-sync-daemon wiki article for additional information on it.

新しいブラウザインスタンスを起動

When you launch the browser, it first checks if another instance using the same profile is already running. If there is one, the new window is associated with the old instance. To prevent this, you can specifically ask the browser to run with a different profile.

$ chromium --user-data-dir=<PATH TO A PROFILE>
ノート: It won't work if you specify a link or even a symlink to your regular chromium profile (typically ~/.config/chromium/Default). If you want to use the same profile as your current one for this new instance, first copy the folder ~/.config/chromium/Default to a directory of your choice, keeping the same Default name, and launch the browser using the following command by specifying the parent folder of the Default folder you have just copied.

For example, if you copied the Default folder to ~/Downloads: $ chromium --user-data-dir=~/Downloads.

torrent クライアントで *.torrent ファイルやマグネットリンクを直接開く

By default, Chromium downloads *.torrent files directly and you need to click the notification from the bottom left corner of the screen in order for the file to be opened with your default torrent client. This can be avoided with the following method:

  • Download a *.torrent file.
  • Right click the notification displayed at the bottom left corner of the screen.
  • Check the "Always Open Files of This Type" checkbox.

デフォルトの関連付けの変更については xdg-open を見てください。

タッチスクリーンデバイスでタッチスクロール

Chrome と Chromium はデフォルトではタッチスクリーンをサポートしていません。chrome の 'flags' から変更できる設定がいくつかあり、あなたの使用しているデバイスで使うことができるかもしれません。公式リポジトリの chromium や AUR の google-chromeAUR でテスト済みです。

  • Browse to chrome://flags and set everything to default
  • Switch "Enable Touch events" to "Enabled" (chrome://flags/#touch-events)
  • Restart Chrome and touch scrolling should work. If it does not, it is worth trying the other modes that are available.
  • You may need to specify which touch device to use. Find your touchscreen device with xinput list then launch Chromium with the --touch-devices=x parameter, where "x" is the id of your device.
    ノート: If the device is designated as a slave pointer, using this may not work, use the master pointer's ID instead.

システムトレイアイコンの無効化

ブラウザから chrome://flags を開いて以下のフラグを無効にしてください:

  • device-discovery-notifications

そしてページの下部にある再起動ボタンを押して下さい。

メモリの使用量を減らす

By default, Chromium uses a separate OS process for each instance of a visited web site. [1] However, you can specify command-line switches when starting Chromium to modify this behaviour.

For example, to share one process for all instances of a website:

$ chromium --process-per-site

To use a single process model:

$ chromium --single-process
警告: While the single-process model is the default in Firefox [2] and other browsers, it may contain bugs not present in other models. [3]

In addition, you can suspend or store inactive Tabs with extensions such as Tab Suspender and OneTab.

ユーザーエージェント

The User Agent can be arbitrarily modified at the start of Chromium's base instance via its --user-agent="[string]" parameter.

For the same User Agent as the stable Chrome release for Linux i686 (at the time of writing, the most popular Linux edition of Chrome) one would use:

--user-agent="Mozilla/5.0 (X11; Linux i686) AppleWebKit/535.2 (KHTML, like Gecko) Chrome/20.0.1132.47 Safari/536.11"

An official, automatically updated listing of Chromium releases which also shows the included WebKit version is available as the OmahaProxy Viewer.

プロファイルのメンテナンス

Chromium は Sqlite データベースを使用して履歴やお気に入りを管理しています。Sqlite データベースは使っているうちに断片化していきます。しかしながら、データベースをチェックしたり最適化するプロセスが存在しないため、断片化によって段々とパフォーマンスに影響が出て来ます。デフラグを行ってデータベースから未使用領域を削除することで、起動時間やブックマークや履歴に関連する作業を素早く実行することができます。

AURprofile-cleanerAURbrowser-vacuumAUR でメンテナンスができます。

セキュリティ

WebRTC

WebRTC is a communication protocol that relies on JavaScript that can leak one's actual IP address from behind a VPN. While software like NoScript prevents this, it's probably a good idea to block this protocol directly as well, just to be safe. An option to disable it is available via an extension.

One can test this via this page.

安全でない RC4 暗号を無効化

The RC4 cipher has been declared as insecure, but the cipher is still in Chromium at present. To disable it:

$ chromium --cipher-suite-blacklist=0x0001,0x0002,0x0004,0x0005,0x0017,0x0018,0xc002,0xc007,0xc00c,0xc011,0xc016,0xff80,0xff81,0xff82,0xff83

You can check which cipher suites are supported by your browser at https://cc.dcsec.uni-hannover.de/. Make sure to visit this page before and after you make the change to verify that the change was effective.

To make the change persistent, you can modify ~/.config/chromium-flags.conf and add the flags above. To check, open the website mentioned before. An alternative is to grep inside of your process list for the keyword "cipher".

参考資料

There is no cleaner way to disable RC4. Also, the source-code only shows the right hexadecimal value for the single cipher. See Wikipedia:RC4 for basic information and a recommendation to disable RC4.

German Blog showing how to disable RC4 in common browsers.

1024ビットの Diffie-Hellman 鍵交換を無効化

Following recent research it is likely that the NSA has been breaking 1024-bit Diffie-Hellman for some time now. To disable these use:

$ chromium --cipher-suite-blacklist=0x0033,0x0039,0x009E,0xcc15

(best in combination with disabling RC4, s. a.), restart the browser and check how your SSL is.

SSL 証明書

Chromium does not have an SSL certificate manager. It relies on the NSS Shared DB ~/.pki.nssdb. In order to add SSL certificates to the database, users will have to use the shell.

自己署名証明書の CAcert 証明書を追加

Grab the CAcerts and create an nssdb, if one does not already exist. To do this, first install the nss package, then complete these steps:

$ mkdir -p $HOME/.pki/nssdb
$ cd $HOME/.pki/nssdb
$ certutil -N -d sql:.
$ curl -k -o "cacert-root.crt" "http://www.cacert.org/certs/root.crt"
$ curl -k -o "cacert-class3.crt" "http://www.cacert.org/certs/class3.crt"
$ certutil -d sql:$HOME/.pki/nssdb -A -t TC -n "CAcert.org" -i cacert-root.crt 
$ certutil -d sql:$HOME/.pki/nssdb -A -t TC -n "CAcert.org Class 3" -i cacert-class3.crt
ノート: Users will need to create a password for the database, if it does not exist.

Now users may manually import a self-signed certificate.

例 1: シェルスクリプトを使って TomatoUSB から証明書を分離

Below is a simple script that will extract and add a certificate to the user's nssdb:

#!/bin/sh
#
# usage:  import-cert.sh remote.host.name [port]
#
REMHOST=$1
REMPORT=${2:-443}
exec 6>&1
exec > $REMHOST
echo | openssl s_client -connect ${REMHOST}:${REMPORT} 2>&1 |sed -ne '/-BEGIN CERTIFICATE-/,/-END CERTIFICATE-/p'
certutil -d sql:$HOME/.pki/nssdb -A -t TC -n "$REMHOST" -i $REMHOST 
exec 1>&6 6>&-

Syntax is advertised in the commented lines.

例 2: Firefox を使って TomatoUSB から証明書を分離

firefox ブラウザを使って証明書をファイルに保存してデータベースに手動でインポートすることができます。

Using firefox:

  1. Browse to the target URL.
  2. Upon seeing the "This Connection is Untrusted" warning screen, click: I understand the Risks > Add Exception...
  3. Click: View > Details > Export and save the certificate to a temporary location (/tmp/easy.pem in this example).

Now import the certificate for use in Chromium:

$ certutil -d sql:$HOME/.pki/nssdb -A -t TC -n "easy" -i /tmp/easy.pem
ノート: Adjust the name to match that of the certificate. In the example above, "easy" is the name of the certificate.

フラグを永続的に設定

ノート: chromium 42.0.2311.90-1 からユーザー個別のフラグのみがサポートされています。

$HOME/.config/ (あるいは環境変数を設定している場合 $XDG_CONFIG_HOME) にある chromium-flags.conf ファイルにフラグを記述できます。

特殊な構文はありません。ターミナルに書くのと同じようにフラグは定義します。

  • The arguments are split on whitespace and shell quoting rules apply, but no further parsing is performed.
  • In case of improper quoting anywhere in the file, a fatal error is raised.
  • Flags can be placed in separate lines for readability, but this is not required.
  • Lines starting with a hash symbol (#) are skipped.

以下は chromium-flags.conf ファイルで --start-maximized --incognito フラグを定義する例です:

# This line will be ignored.
--start-maximized
--incognito
ヒント: Pepper Flash をインストールしている場合、ランチャーが自動的に Chromium に適当なフラグを指定するので --ppapi-flash-* フラグを定義する必要はありません。
ノート: chromium-flags.conf ファイルは Arch Linux の固有のファイルで chromium 42.0.2311.90-1 で追加されたカスタムランチャースクリプトでサポートされています。

参照