Firefox/設定
このページでは Firefox の高度な設定オプションとパフォーマンスを上げる設定を説明します。
パフォーマンス
Improving Firefox's performance is divided into parameters that can be inputted while running Firefox or otherwise modifying its configuration as intended by the developers, and advanced procedures that involve foreign programs or scripts.
Firefox の高度なオプション
This section contains advanced Firefox options for performance tweaking. For additional information see these Mozillazine forum posts.
ネットワーク設定
Advanced network settings can be found on the about:config
page (try searching for network).
Key | Value | Description |
---|---|---|
network.http.pipelining | true | Enable pipelining for normal connections |
network.http.proxy.pipelining | true | Enable pipelining for proxy connections |
アンチフィッシングの無効化
The anti-phishing features of Firefox may cause Firefox to become slow to start or exit. The problem is that Firefox maintains an Sqlite database that can grow quite big which makes reading and writing slower after repeated use. If you feel that you do not need Firefox to tell you which sites may be suspect you can disable this feature:
- Turn off the following options under the security tab in preferences: "Block reported attack sites" and "Block reported web forgeries".
- Delete all files beginning with
urlclassifier
in your profile folder (~/.mozilla/firefox/<profile_dir>/
):
$ rm -i ~/.mozilla/firefox/<profile_dir>/urlclassifier*
- Some of these files might be recreated by Firefox, but they won't grow any larger than their initial size.
urlclassifier3.sqlite が作成されないようにする
If you did remove all the urlclassifier*
files as mentioned above, you may find out that urlclassifier3.sqlite
keeps growing again after a certain time. Here is a simple solution to avoid it for now and ever.
$ cd ~/.mozilla/firefox/<profile_dir> $ echo "" > urlclassifier3.sqlite $ chmod 400 urlclassifier3.sqlite
This effectively makes the file empty and then read-only so Firefox cannot write to it anymore.
OCSP 検証の無効化
OCSP validation may cause Firefox to become slower for each (HTTPS) connection to a new server. This is worse, recently, where web gadgets are included in pages via HTTPS (e.g., "like" buttons of the social networks), resulting in many connections for a single URL.
- Turn off the following option under Preferences -> Advanced -> Certificates -> Validation: "Use the Online Certificate Status Protocol (OCSP) to confirm the current validity of certificates".
ディスクキャッシュの無効化
Every object loaded (html pages, jpeg images, css stylesheets, gif banners) is saved in the Firefox cache, to be loaded in the future without to download it again from the server, but only fraction of these objects will be really reused without download (usually the 30%). This because of too short expiration times for the objects, updates or simply the user behavior (to load new pages instead the ones already visited). The Firefox cache is divided in memory and disk cache and using the disk cache results to frequent disk writes, because every time an object loaded it is written to the disk and some older object is removed.
- Turn on the following option under the advanced tab in preferences -> Network -> Validation: "Override automatic cache management" and specify zero in "Limit cache to".
セッションを保存する間隔を長くする
The Firefox session store automatically saves the current status (opened urls, cookies, history and bookmarks) to the disk every 15 seconds. It may be too frequent for the user needs, resulting in a frequent disk access.
This setting can be found on the about:config
page (try searching for sessionstore).
- browser.sessionstore.interval 300000
即座にページをレンダリング
Mozilla applications render web pages incrementally - they display what's been received of a page before the entire page has been downloaded. Since the start of a web page normally doesn't have much useful information to display, Mozilla applications will wait a short interval before first rendering a page. This preference controls that interval. Note that if you are on slower connections (dial up) changing this setting might make web pages load for longer times even though the page appears faster.
This setting can be created in the about:config
page as
- nglayout.initialpaint.delay with a value of 0.
その他の設定
This section contains some other modifications that may increase Firefox's performance.
UPX で Firefox バイナリを圧縮して起動時間を短縮
UPX is an executable packer that supports very fast decompression and induces no memory overhead. It can be installed with the upx package, availalble in the official repositories.
Before using upx
to compress the Firefox executable, make a backup of the binary:
# cp /usr/lib/firefox/firefox /usr/lib/firefox/firefox.backup
Finally, invoke upx
, applying the best possible compression level:
# upx --best /usr/lib/firefox/firefox
プロファイルの SQLite データベースのデフラグ
In Firefox 3.0, bookmarks, history, passwords are kept in an SQLite databases. SQLite databases become fragmented over time and empty spaces appear all around. But, since there are no managing processes checking and optimizing the database, these factors eventually result in a performance hit. A good way to improve start-up and some other bookmarks and history related tasks is to defragment and trim unused space from these databases.
profile-cleanerAUR in the AUR does just this.
SQLite database | Size Before | Size After | % change |
---|---|---|---|
urlclassifier3.sqlite | 37 M | 30 M | 19 % |
places.sqlite | 16 M | 2.4 M | 85 % |
tmpfs でプロファイルを RAM にキャッシュ
If the system has memory to spare, tmpfs
can be used to cache the entire profile directory, which might result in increased Firefox responsiveness.
外観
フォント
次の記事を参照してください: フォント設定
DPI の値の設定
Modifying the following value can help improve the way fonts looks in Firefox if the system's DPI is below 96. Firefox, by default, uses 96 and only uses the system's DPI if it is a higher value. To force the system's DPI regardless of its value, type about:config
into the address bar and set layout.css.dpi
to 0.
Note that the above method only affects the Firefox user interface's DPI settings. Web page contents still use a DPI value of 96, which may look ugly or, in the case of high-resolution displays, may be rendered too small to read. A solution is to change layout.css.devPixelsPerPx
to system's DPI divided by 96. For example, if your system's DPI is 144, then the value to add is 144/96 = 1.5. Changing layout.css.devPixelsPerPx
to 1.5 makes web page contents use a DPI of 144, which looks much better.
See also HiDPI#Firefox for information about HiDPI displays.
Microsoft Windows のデフォルトフォント設定
以下は Firefox を Microsoft Windows にインストールした時のデフォルトフォント設定です。多くのウェブサイトは Microsoft フォントを使っています。
Proportional: Serif Size (pixels): 16 Serif: Times New Roman Sans-serif: Arial Monospace: Courier New Size (pixels): 13
一般的なユーザーインターフェイスの CSS 設定
Firefox's user interface can be modified by editing the userChrome.css
and userContent.css
files in ~/.mozilla/firefox/<profile_dir>/chrome/
(profile_dir is of the form hash.name, where the hash is an 8 character, seemingly random string and the profile name is usually default).
This section only deals with the userChrome.css
file which modifies Firefox's user interface, and not web pages.
フォントの変更
The setting effectively overrides the global GTK+ font preferences, and does not affect webpages, only the user interface itself:
~/.mozilla/firefox/<profile_dir>/chrome/userChrome.css
* { font-family: "FONT_NAME"; }
ボタンアイコンの隠匿
Enables text-only buttons:
~/.mozilla/firefox/<profile_dir>/chrome/userChrome.css
.button-box .button-icon { display: none; }
様々なタブボタンの隠匿
These settings hide the arrows that appear to the horizontal edges of the tab bar, the button that toggles the "all tabs" drop-down list, and the plus sign button that creates a new tab.
~/.mozilla/firefox/<profile_dir>/chrome/userChrome.css
/* Tab bar */ .tabbrowser-strip *[class^="scrollbutton"] { /* Hide tab scroll buttons */ display: none; } .tabbrowser-strip *[class^="tabs-alltabs"] { /* Hide tab drop-down list */ display: none; } .tabbrowser-strip *[class^="tabs-newtab-button"] { /* Hide new-tab button */ display: none; }
水平タブ
To place the tab bar horizontally stacked along the sides of the browser window:
~/.mozilla/firefox/<profile_dir>/chrome/userChrome.css
/* Display the tabbar on the left */ #content > tabbox { -moz-box-orient: horizontal; } .tabbrowser-strip { -moz-box-orient: vertical; /* * You can set this to -moz-scrollbars-vertical instead, * but then the scrollbar will *always* be visible. this way * there is never a scrollbar, so it behaves like the tab bar * normally does */ overflow: -moz-scrollbars-none; } .tabbrowser-tabs { -moz-box-orient: horizontal; min-width: 20ex; /* You may want to increase this value */ -mox-box-pack: start; -moz-box-align: start; } .tabbrowser-tabs > hbox { -moz-box-orient: vertical; -moz-box-align: stretch; -moz-box-pack: start; } .tabbrowser-tabs > hbox > tab { -moz-box-align: start; -moz-box-orient: horizontal; }
ブックマークツールバーを自動で隠匿
~/.mozilla/firefox/<profile_dir>/chrome/userChrome.css
#PersonalToolbar { visibility: collapse !important; } #navigator-toolbox:hover > #PersonalToolbar { visibility: visible !important; }
サイドバーの幅の制限をなくす
~/.mozilla/firefox/<profile_dir>/chrome/userChrome.css
/* remove maximum/minimum width restriction of sidebar */ #sidebar { max-width: none !important; min-width: 0px !important; }
ウェブコンテンツの CSS 設定s
This section deals with the userContent.css
file in which you can add custom CSS rules for web content. Changes to this file will take effect once the browser is restarted.
This file can be used for making small fixes or to apply personal styles to frequently visited websites. Custom stylesheets for popular websites are available from sources such as userstyles.org. You can install an add-on such as superUserContent to manage themes. This add-on creates the directory chrome/userContent.css.d
and applies changes to the CSS files therein when the page is refreshed.
他の CSS ファイルのインポート
~/.mozilla/firefox/<profile_dir>/chrome/userContent.css
@import url("./imports/some_file.css");
ドメインの特定部位をブロック
~/.mozilla/firefox/<profile_dir>/chrome/userContent.css
@-moz-document domain(example.com) { div#header { background-image: none !important; } }
PDF ファイルのリンクの後ろに [pdf] を追加
~/.mozilla/firefox/<profile_dir>/chrome/userContent.css
/* add '[pdf]' next to links to PDF files */ a[href$=".pdf"]:after { font-size: smaller; content: " [pdf]"; }
リンクにマウスが乗ったときに画面下に URL を表示
~/.mozilla/firefox/<profile_dir>/chrome/userContent.css
a[href]:hover { text-decoration: none !important; } a[href]:hover:after { content: attr(href); position: fixed; left: 0px; bottom: 0px; padding: 0 2px !important; max-width: 95%; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; font:10pt sans-serif !important; background-color: black !important; color: white !important; opacity: 0.7; z-index: 9999; }
Firefox 4 の新しいメニューバー/Firefox ボタン
To toggle between the new Firefox button and the classic menu bar:
- if the button is active, check Preferences > Menu Bar, or right click in the toolbar area and check Menu Bar.
- if the menu bar is active, uncheck View > Toolbars > Menu Bar, or right click in the toolbar area and uncheck Menu Bar.
In GNU/Linux, you will just get a plain grey button instead of the new orange one from Windows. However you can change this to either a Firefox icon or the icon followed by the "Firefox" text.
Adding the following to your ~/.mozilla/firefox/userprofile/chrome/userChrome.css
file will place the icon before the text:
#appmenu-toolbar-button { list-style-image: url("chrome://branding/content/icon16.png"); }
Adding the following to the same file will remove the "Firefox" text:
#appmenu-toolbar-button > .toolbarbutton-text, #appmenu-toolbar-button > .toolbarbutton-menu-dropmarker { display: none !important; }
This userChrome.css configuration copies the default Windows Firefox 4+ look and adds an orange background to the button, with a purple background in Private Browsing mode:
#main-window:not([privatebrowsingmode]) #appmenu-toolbar-button { -moz-appearance: none !important; color: #FEEDFC !important; background: -moz-linear-gradient(hsl(34,85%,60%), hsl(26,72%,53%) 95%) !important; border: 1px solid #000000 !important; } #main-window:not([privatebrowsingmode]) #appmenu-toolbar-button:hover:not(:active):not([open]) { -moz-appearance: none !important; color: #FEEDFC !important; background: -moz-linear-gradient(hsl(26,72%,53%), hsl(34,85%,60%) 95%) !important; border: 1px solid #000000 !important; } #main-window:not([privatebrowsingmode]) #appmenu-toolbar-button:hover:active, #main-window:not([privatebrowsingmode]) #appmenu-toolbar-button[open] { -moz-appearance: none !important; color: #FEEDFC !important; background: -moz-linear-gradient(hsl(26,72%,53%), hsl(26,72%,53%) 95%) !important; border: 1px solid #000000 !important; } #appmenu-toolbar-button { -moz-appearance: none !important; color: #FEEDFC !important; background: -moz-linear-gradient(hsl(279,70%,46%), hsl(276,75%,38%) 95%) !important; border: 1px solid #000000 !important; } #main-window #appmenu-toolbar-button:hover:not(:active):not([open]) { -moz-appearance: none !important; color: #FEEDFC !important; background: -moz-linear-gradient(hsl(276,75%,38%), hsl(279,70%,46%) 95%) !important; border: 1px solid #000000 !important; } #main-window #appmenu-toolbar-button:hover:active, #main-window #appmenu-toolbar-button[open] { -moz-appearance: none !important; color: #FEEDFC !important; background: -moz-linear-gradient(hsl(276,75%,38%), hsl(276,75%,38%) 95%) !important; border: 1px solid #000000 !important; }
広告のブロック
See floppymoose.com for an example of how to use userContent.css
as a basic ad-blocker.
その他
Other tips and tweaks.
マウスホイールでスクロールする速度
マウスホイールによるスクロール速度のデフォルト値を修正するには (例: スピードアップ)、about:config
を開いて mousewheel.acceleration
を検索してください。利用可能なオプションが表示されるので、以下を修正します:
mousewheel.acceleration.start
を -1 に設定。mousewheel.acceleration.factor
を適当な値に設定 (10 から 20 が普通使われる値です)。
もしくは SmoothWheel add-on をインストールすることでも変更できます。
Firefox 検索バーの検索エンジンの順番を変更
To change the order search engines are displayed in:
- Open the drop-down list of search engines and click Manage Search Engines... entry.
- Highlight the engine you want to move and use Move Up or Move Down to move it. Alternatively, you can use drag-and-drop.
Abiword や LibreOffice Writer で *.doc を自動的に開く方法
Go to Preferences > Applications and search for Word Document (or Word 2007 Document for *.docx
). After finding it, click the drop-down list and select Use other.... From there you have to specify the exact path to the Abiword or Writer executable (i.e./usr/bin/abiword
or /usr/bin/lowriter
).
"I'm Feeling Lucky" モード
Some search engines have a "feeling lucky" feature. For example, Google has "I'm Feeling Lucky", and DuckDuckGo has "I'm Feeling Ducky".
To activate them:
- Type
about:config
in the address bar. - Search for the string
keyword.url
. - Modify its value (if any) to the URL of the search engine.
For Google, set it to:
https://www.google.com/search?btnI=I%27m+Feeling+Lucky&q=
For DuckDuckGo, set it to:
https://duckduckgo.com/?q=\
DNSSEC で DNS をセキュア化
You can enable DNSSEC support for safer browsing.
マグネットプロトコルの関連付けの追加
In about:config
set network.protocol-handler.expose.magnet
to false.
The next time you open a magnet link, you will be prompted with a Launch Application
dialogue. From there simply select your chosen torrent client. This technique can also be used with other protocols.
突然終了してしまうのを防ぐ
The Disable Ctrl-Q Shortcut extension can be installed to prevent unwanted closing of the browser.
An alternative is to add a rule in your window manager configuration file. For example in openbox add:
<keybind key="C-q"> <action name="Execute"> <execute>false</execute> </action> </keybind>
in the <keyboard> section of your rc.xml
file.
最新版でプラグインが動作しない
Arch はブリーディングエッジなので、最新の Firefox では動作しないプラグインと互換性の問題が起こることがあります (例: Pentadactyl)。可能であれば、ナイトリー/ベータ版をインストールするか、パッケージのダウングレードを見て下さい。
Disable Add-on Compatibility Checks plugin should take care of spurious compatibility issues when the plugins get disabled, even though they work just fine with the new version.
スクロールがギクシャクしている
Scrolling in Firefox can feel "jerky" or "choppy". A post on MozillaZine gives settings that work on Gentoo, but reportedly work on Arch Linux as well:
- Set
mousewheel.min_line_scroll_amount
to 40 - Set
general.smoothScroll
andgeneral.smoothScroll.pages
to false - Set
image.mem.min_discard_timeout_ms
to something really large such as 2100000000 but no more than 2140000000. Above that number Firefox will not accept your entry and complain with the error code: "The text you entered is not a number." - Set
image.mem.max_decoded_image_kb
to at least 512K
Now scrolling should flow smoothly.
WebRTC で LAN IP アドレスが判明する
To prevent websites from getting your local IP address via WebRTC's peer-to-peer (and JavaScript), open about:config
and set media.peerconnection.enabled
to false (or use this addon).