fang5566
管理员
管理员
  • UID3719
  • 注册日期2005-03-07
  • 最后登录2024-05-09
  • 发帖数18483
  • 经验4837枚
  • 威望5点
  • 贡献值4316点
  • 好评度1116点
  • 社区居民
  • 最爱沙发
  • 忠实会员
  • 终身成就
阅读:16058回复:5

Firefox 主要的命令行参数

楼主#
更多 发布于:2017-10-09 14:23
Ghacks 介绍了一些 Firefox 主要的命令行参数,这里说的命令行参数是指在 Firefox 快捷方式上右键点击属性中的,启动路径后面的参数:



和配置文件有关的参数:
  • -CreateProfile 配置名 -- 可创建一个新的用户配置,但不会马上用此配置启动。
  • -CreateProfile "配置名 配置路径" -- 可创建一个新的用户配置,并可以自定义该配置的实际路径。
  • -ProfileManager-P -- 打开内置的配置管理器界面。
  • -P "配置名" -- 使用自定义名称的配置来启动 Firefox。如果这个配置名不存在,则打开配置管理器。如果有其他 Firefox 实例正在运行,则该参数无法生效。
  • -no-remote -- 在 -P 后面添加这个参数,可以创建一个新的实例,实现同时使用多个Firefox 配置

和浏览器有关的参数:
  • -headless -- 无边框模式启用 Firefox。最低要求的版本是Linux 为 Firefox 55,Win 和 Mac OS X 则是 Firefox 56。
  • -new-tab URL -- 在 Firefox 新建一个标签页打开指定的 URL。
  • -new-window URL -- 在 Firefox 新建一个窗口打开指定的 URL。
  • -private -- 始终在隐私浏览模式启动 Firefox。
  • -private-window -- 新建一个隐私模式窗口。
  • -private-window URL -- 新建一个隐私模式窗口打开指定的 URL。如果已经有隐私模式窗口打开,则在此窗口打开这个 URL。
  • -search term -- 使用 Firefox 默认的搜索引擎进行搜索。
  • -url URL -- 新建一个标签页或窗口打开指定的 URL。可以不添加 -url 字段,如指定多个 URL,则 URL 之间空格分隔。(一些恶意软件经常会篡改这个参数来每次启动时打开特定页面)。

其他一些参数:
  • -safe-mode -- 安全模式启动 Firefox,或者按住 Shift 键打开 Firefox 也可以。
  • -devtools -- 启动 Firefox 时打开开发工具。
  • -inspector URL -- 使用 DOM 查看器查看指定的页面。
  • -jsconsole -- 启动 Firefox 时打开浏览器控制台。
  • -tray -- 启用 Firefox 时最小化。



https://www.ghacks.net/2017/10/08/the-most-important-firefox-command-line-options/

最新喜欢:

10sun10sun hillhill dsyo2008dsyo20... l10xl10x
Firefox More than meets your experience
taoww
非常火狐
非常火狐
  • UID39284
  • 注册日期2013-03-18
  • 最后登录2024-05-16
  • 发帖数634
  • 经验580枚
  • 威望0点
  • 贡献值110点
  • 好评度104点
1楼#
发布于:2017-10-09 14:52
其实按照类unix系统的习惯,直接命令行下用firefox --help就把支持的选项全部列出来了。可惜windows非要默认关闭gui程序的命令行输出,导致windows下的命令行提示符和powershell之类的用这个都不会显示任何东西。还要找类似cygwin的终端那种第三方软件才能显示出来

另外给个MDN的链接作为补充
英文版 https://developer.mozilla.org/en-US/docs/Mozilla/Command_Line_Options
中文版(不及英文版新) https://developer.mozilla.org/zh-CN/docs/Mozilla/Command_Line_Options
fang5566
管理员
管理员
  • UID3719
  • 注册日期2005-03-07
  • 最后登录2024-05-09
  • 发帖数18483
  • 经验4837枚
  • 威望5点
  • 贡献值4316点
  • 好评度1116点
  • 社区居民
  • 最爱沙发
  • 忠实会员
  • 终身成就
2楼#
发布于:2017-10-09 15:00
taoww:其实按照类unix系统的习惯,直接命令行下用firefox --help就把支持的选项全部列出来了。可惜windows非要默认关闭gui程序的命令行输出,导致windows下的命令行提示符和powershell之类的用这个都不会显示任何东西...回到原帖
这个才是完全版的啊!!
Firefox More than meets your experience
adonais
小狐狸
小狐狸
  • UID4338
  • 注册日期2005-03-24
  • 最后登录2020-10-02
  • 发帖数99
  • 经验48枚
  • 威望0点
  • 贡献值4点
  • 好评度0点
  • 社区居民
  • 忠实会员
3楼#
发布于:2017-10-09 15:59
taoww:其实按照类unix系统的习惯,直接命令行下用firefox --help就把支持的选项全部列出来了。可惜windows非要默认关闭gui程序的命令行输出,导致windows下的命令行提示符和powershell之类的用这个都不会显示任何东西...回到原帖
也不用找第三方终端类的软件.
firefox --help >> 2.log
就行了,参数都在2.log文件里.
Wizard_Ph
小狐狸
小狐狸
  • UID55956
  • 注册日期2017-09-09
  • 最后登录2019-06-15
  • 发帖数9
  • 经验10枚
  • 威望0点
  • 贡献值4点
  • 好评度1点
4楼#
发布于:2017-10-09 16:18
Usage: firefox [ options ... ] [URL]
       where options include:

  -h or --help       Print this message.
  -v or --version    Print Firefox version.
  -P <profile>       Start with <profile>.
  --profile <path>   Start with profile at <path>.
  --migration        Start with migration wizard.
  --ProfileManager   Start with ProfileManager.
  --no-remote        Do not accept or send remote commands; implies
                     --new-instance.
  --new-instance     Open new instance, not a new window in running instance.
  --UILocale <locale> Start with <locale> resources as UI Locale.
  --safe-mode        Disables extensions and themes for this session.
  --console          Start Firefox with a debugging console.
  --headless         Run without a GUI.
  --marionette       Enable remote control server.
  --browser          Open a browser window.
  --new-window <url> Open <url> in a new window.
  --new-tab <url>    Open <url> in a new tab.
  --private-window <url> Open <url> in a new private window.
  --preferences      Open Options dialog.
  --screenshot [<path>] Save screenshot to <path> or in working directory.
  --window-size width[,height] Width and optionally height of screenshot.
  --search <term>    Search <term> with your default search engine.
  --jsconsole        Open the Browser Console.
  --jsdebugger       Open the Browser Toolbox.
  --wait-for-jsdebugger Spin event loop until JS debugger connects.
                     Enables debugging (some) application startup code paths.
                     Only has an effect when `--jsdebugger` is also supplied.
  --devtools         Open DevTools on initial load.
  --start-debugger-server [ws:][ <port> | <path> ] Start the debugger server on
                     a TCP port or Unix domain socket path. Defaults to TCP port
                     6000. Use WebSocket protocol if ws: prefix is specified.
  --recording <file> Record drawing for a given URL.
  --recording-output <file> Specify destination file for a drawing recording.
  --setDefaultBrowser Set this app as the default browser.

常用的也就一两个。。
bba
bba
小狐狸
小狐狸
  • UID22499
  • 注册日期2007-12-31
  • 最后登录2020-03-13
  • 发帖数67
  • 经验22枚
  • 威望0点
  • 贡献值10点
  • 好评度1点
  • 社区居民
  • 忠实会员
5楼#
发布于:2017-10-09 19:33
感谢了,一直以为-p这个参数已经失效了
游客

返回顶部