我将如何通过外部 .bat 文件修改 Firefox 的 about:config 设置?

Mat*_*ghi 2 firefox script plugins browser-addons about-config

我想通过 Firefox 外部的脚本更改特定 about:config 属性的值。

你们有没有人试过这个?我读过您可以修改“prefs.js”,但我想知道是否有更简单、更正确的方法。例如,也许是:

  • Firefox 可执行文件的命令行参数(在这种情况下可以使用批处理文件)
  • 注册表设置(.reg 文件可以工作)

JYe*_*ton 6

prefs.js 文件中的注释:

# Mozilla User Preferences

/* Do not edit this file.
 *
 * If you make changes to this file while the application is running,
 * the changes will be overwritten when the application exits.
 *
 * To make a manual change to preferences, you can visit the URL about:config
 * For more information, see http://www.mozilla.org/unix/customizing.html#prefs
 */
Run Code Online (Sandbox Code Playgroud)

也就是说,您应该能够在关闭应用程序的情况下编辑文件,新设置将在启动时生效。

但是,取决于您要修改的设置:我认为注册表或命令行选项不会为您提供相同的设置。注册表设置更特定于系统而不是每个用户;和命令行参数将为您提供应用程序的特定实例开关,例如窗口大小和要加载的配置文件等。

如果您知道要更改的特定设置,则可以使用正则表达式在 prefs.js 文件中搜索它(使用 VBScript 将是我的选择)用替换设置编写一个新文件,然后重命名/删除文件,以便新的 prefs.js 取代了前一个。