命令行选项用于为 Mozilla 应用程序指定各类启动选项。例如,您能够使用命令行配置选项来绕过配置档管理器并打开一个特定的配置档(若是您有多个配置档)。您也能够控制 Mozilla 应用程序如何打开,初始打开哪一个组件以及当组件打开时要作什么。这个页面描述经常使用的选项和如何使用它们。html
语法规则
首先,让咱们描述一下适用于全部选项的语法规则。web
- 包含空格的命令参数必须以引号括起;例如 "Joel User"。
- 命令操做是不区分大小写的。
- 命令参数,除了配置档名称外都是不区分大小写的。
- 空格( )用于间隔多个命令和参数。
- 每条消息选项都遵循语法
字段=值
,例如:to=
foo@nowhere.net
subject=cool page
attachment=www.mozilla.org
attachment='file:///c:/test.txt'
body=check this page
- 多个消息选项用逗号(,)间隔,例如:
"to=foo@nowhere.net,subject=cool page"。逗号分隔符必定不能尾随或前缀空格
( )。要指派多个值给一个字段,使用单引号(')闭合值,例如:"to='foo@nowhere.net,foo@foo.de',subject=cool page"
。
使用命令行选项
命令行选项在启动应用程序的命令后输入。某些选项选项有参数。它们在命令行选项后输入。某些选项有缩写替代。例如,命令行选项 "-editor" 能够缩写为 "-edit"。(其中可用的缩写将会在下面的文本中阐述) 在某些状况下,选项参数必须用引号括起。(这会在如下的选项描述中注明。) 能够指定多个命令行选项。一般,语法以下:chrome
应用程序 -选项 -选项 "参数" -选项 参数
示例
下列示例显示 "-ProfileManager" 命令的使用,它将会在启动 Firefox 或 Thunderbird 前打开配置档管理器:shell
Windows
从 Windows 开始菜单中选择运行,输入:浏览器
firefox -ProfileManager
Mac OS X
转到 Applications > Utilities,打开终端并输入:网络
cd /Applications/Firefox.app/Contents/MacOS
./firefox -ProfileManager
Linux
打开终端并输入:app
cd Thunderbird 安装目录
./thunderbird -ProfileManager
以上示例调用 "-ProfileManager" 命令行选项用于 Mozilla 的 Thunderbird 邮件客户端。less
用户配置档
-CreateProfile profile_name
建立一个名为profile_name 的配置档,而不启动程序。profile_name 必定不能包含空格( )。编辑器
firefox -CreateProfile JoelUser
-CreateProfile "profile_name profile_dir"
在目录 profile_dir 中建立一个名为 profile_name 的配置档而不启动应用程序。注意 profile_name 和 profile_dir 必须括在一块儿。(在 SeaMonkey1.x 中未有)ide
注: profile_dir 必须存在并且您必须还未有称为 profile_name 的配置档。
firefox -CreateProfile "JoelUser c:\internet\moz-profile"
-ProfileManager
使用配置档管理器启动。
-SelectProfile
使用配置档选择对话框启动。仅用于 SeaMonkey1.x。
-ProfileWizard
使用配置档向导启动。仅用于 SeaMonkey1.x。
-P "profile_name"
绕过配置档管理器并使用名为profile_name 的配置档启动。对于处理多个配置档颇有用。注意profile_name 是区分大小写的。若是您未指定一个配置档名称,那么就会打开配置档管理器。在 L:inux 上,您必须使用大写字母 P,由于小写调用 Purify 模式(内存和泄露探测)。其它平台大小写都接受。
firefox -P "Joel User"
-profile "profile_path"
使用给出路径的配置档启动。仅用于 Firefox、Thunderbird 和 SeaMonkey2.x。
"profile_path"
能够是一个绝对路径("/path/to/profile"
) 或一个相对路径("path/to/profile"
).
-no-remote
容许同一事件打开多个应用程序副本。(在 SeaMonkey1.x 中无效,它仅支持 MOZ_NO_REMOTE=1
)。
firefox -no-remote -P "另外一个配置档"
-migration
使用导入向导启动。(SeaMonkey1.x 中无效)
-installer
使用 Netscape 4.x 迁移窗口启动。仅用于 SeaMonkey1.x。
-resetPref preference
重置指定的首选项(逗号间隔)为默认值。仅用于 SeaMonkey1.x。
seamonkey -resetPref browser.startup.homepage
-override /path/to/override.ini
加载指定的 override.ini
文件以覆盖 application.ini
(browser/app/application.ini
)中的配置。经过加载下列 override.ini
能够抑制在启动时的迁移向导。仅用于 Firefox。
[XRE]
EnableProfileMigrator=0
浏览器
-browser
使用 browser(浏览器)组件启动。仅用于 Firefox 和 SeaMonkey。
-url URL
根据浏览器选项,在新标签页或窗口中打开 URL。-url
能够省略。仅用于 Firefox 和 SeaMonkey。注: 当打开多个 URLs 时,Firefox 老是把它们打开为一个新窗口中的选项页。
firefox www.mozilla.com
-private
以私密浏览模式打开 Firefox,而不考虑当前的用户首选项。仅用于 Firefox 3.6 和之后版本。
-new-tab URL
在新标签页中打开 URL。仅用于 Firefox 和 SeaMonkey2.x。
-new-window URL
在新窗口中打开 URL。仅用于 Firefox 和 SeaMonkey2.x。
-search term
使用您的默认搜索引擎搜索 term。仅用于 Firefox 和 SeaMonkey2.x 及之后的版本。
-preferences
打开选项/首选项窗口。仅用于 Firefox 和 SeaMonkey2.x。
-setDefaultBrowser
设置应用程序为默认的浏览器。仅用于 Firefox。
邮件/新闻
-mail
使用邮件客户端启动。仅用于 Thunderbird 和 SeaMonkey。
-mail mailto_URL
为给出的 mailto_URL 启动撰写消息的窗口。仅用于 Thunderbird。
thunderbird -mail mailto:me@isp.net?subject=hi
-news
news_URL
使用新客户端启动。若是给出了 news_URL (可选),则打开指定的新闻组。仅用于 Thunderbird 和 SeaMonkey。
thunderbird -news news://server/group
-compose message_options
使用邮件撰写器启动。查看语法规则。仅用于 Thunderbird 和 SeaMonkey。
thunderbird -compose "to=foo@nowhere.net"
-addressbook
使用地址簿启动。仅用于 Thunderbird 和 SeaMonkey。
-options
打开选项/首选项窗口。仅用于 Thunderbird。
-offline
以离线模式启动。仅用于 Thunderbird 和 SeaMonkey。
-setDefaultMail
设置应用程序为默认的邮件客户端。仅用于 Thunderbird。
日历
-calendar
使用日历客户端启动。仅用于 Sunbird。
-subscribe URL
或 -url URL
订阅到给出的 URL。仅用于 Sunbird。
-showdate 日期
显示给出的日期的您的计划安排。仅用于 Sunbird。
sunbird -showdate 08/04/2008
其它组件
-editor URL
或 -edit URL
为给出的 URL 使用编辑器(撰写器)启动(其中 URL 是可选的)。仅用于 SeaMonkey。
seamonkey -edit www.mozilla.org
-jsconsole
使用错误控制台启动应用程序.
-inspector URL
使用 DOM Inspector 启动(若是已安装的话),并观察给出的 URL (其中 URL 是可选的)。
-venkman
使用 JavaScript 调试器 Venkman 启动(若是已安装的话)。
-chat
使用 IRC 客户端 ChatZilla 启动(若是已安装的话)。
XULRunner
-app /path/to/application.ini
启动一个新进程运行在指定路径 path/to 处的 XULRunner 应用程序。仅用于 Firefox 版本 3 和以上。
Chrome
-chrome chrome_URL
加载指定的 chrome。
firefox -chrome chrome://inspector/content
-register chrome_URL
注册指定的 chrome,而不启动应用程序。
扩展附件
-install-global-extension /path/to/extension
安装扩展到应用程序目录。参数是扩展的路径。您必须有管理权限。(在 SeaMonkey1.x 中无效,可是某些扩展已经把这个做为一个安装时的选项)。
-install-global-theme /path/to/theme
和上面相似,可是只用于主题。您必须有管理权限。(在 SeaMonkey1.x 中无效,可是某些扩展已经把这个做为一个安装时的选项)。
-safe-mode
禁用全部的扩展启动应用程序,仅用于启动。(扩展不会加载,可是不会在扩展管理器数据源中永久禁用)。(在 SeaMonkey1.x 中无效)
语种
-UILocale locale
以 locale 资源做为用户界面的语种。
firefox -UILocale en-US
启动
-turbo
Launch application in Quick Launch mode. SeaMonkey1.x only.
-nosplash
or -quiet
Suppresses display of the splash screen. To show splash screen, use the -splash
command. Note the splash screen is disabled by default on some systems.SeaMonkey1.x only.
远程控制
-remote 远程命令
在一个已经运行的应用程序进程中执行远程命令(查看远程控制)。注: Unix/Linux 仅适用于 SeaMonkey1.x
firefox -remote "openURL(www.mozilla.org, new-tab)"
其它
-silent
不打开默认窗口。对于那些打开它们本身窗口可是未防止默认窗口打开的那些命令行参数颇有用。仅适用于 Firefox、Thunderbird3.x 和 SeaMonkey2.x。
-console
使用一个调试控制台启动应用程序。注:仅适用于 Windows。
-h
或 -help
或 -?
显示全部可用的命令行参数的列表。注意,在 Windows 上仅对调试构建版本(bug 355889)有效。这个选项仅在命令行控制台中可用。
-v
或 -version
打印应用程序版本。注意,在 Windows 上仅对调试构建版本(bug 355889)有效。
-osint
告诉应用程序它是被 OS SHell 启动的。这个不该该指定,除非调用者在启动应用程序时,提供了 OS Shell 的全部功能。(bug 384384).
-requestPending
Tells the application that there will be a Windows DDE request to open the same url specified on the command line. This should not be specified unless the caller provides all of the functionality provided by the OS shell when launching the application (bug 354005).
X11 options
These options are only available for an application build for and running atop the X11/X.org display and window system to be found on Linux and other Unices.
--display=DISPLAY
设置要使用的 X display
--sync
使 X 调用同步
--g-fatal-warnings
使全部警告视为严重
其它须要编写文档的选项
-print-xpcom-dir
-print-xpcom-dirlist
-kill
-killAll
-f
-ftimeout
-fwait
-unsetDefaultMail
-foreground
- GTK options