Firefox 禁用我正在开发的插件

Firefox disable the add on I'm developing

我正在使用最新的 jpm SDK 开发 Firefox 插件。

完成主要代码后,我使用 jpm 运行 命令来 运行 扩展。

但是插件被禁用了。它说 "ADDON NAME could not be verified for use in FIREFOX VERSION and has been disabled."

如图所示。 任何人都知道如何关闭此 Firefox 功能?

来自 comment 上周在 GitHub 问题上留下的相同问题:

Go to about:config and toggle the xpinstall.signatures.required preference.
— Keith94's comment (linked above)

jpm 中的 永久修复 以避免每次执行 "jpm run" 时都必须转到首选项并禁用签名要求是更改 preferences.js您的 jpm 个人资料,如下所示:

"xpinstall.signatures.required" : false

在文件中

npm\node_modules\jpm\data\preferences.js

查看此更改列表以获取示例:https://github.com/mozilla-jetpack/jpm/commit/d7f9b51f73d829e65d900a2cb0eed0cbaa957250

原始答案的来源here

更新:您需要在about:config中将xpinstall.signatures.required设置为false(如上所述)。但是,您不能在使用 jpm 启动时执行此操作(因为它不会持续存在)。相反,您需要通过 firefox 配置文件管理器启动您的配置文件,在 about:config 中进行更改,然后退出配置文件,然后通过 jpm(带有 -p PROFILE_NAME 标志)启动配置文件。此过程类似地适用于您可能想要进行的其他(持久性)更改,例如首选项、书签等。

如果我 运行 通过我的 add-on package.json 文件中指定的脚本执行相同的命令,它会正确加载我的 add-on。

package.json:

{
  ...
  "scripts":{
    "firefox": "jpm run"
  }
}

在terminal/console中:npm run firefox

我不知道为什么会这样

要为 Firefox 开发附加组件,请使用 Developer Edition of Firefox

More about it:

Firefox 42 and beyond:

The Beta and Release versions of Firefox based on 42 and above (Beta 42 will be released at the same time as Firefox 41) will remove the preference that allows unsigned extensions to be installed, and will disable and/or prevent the installation of unsigned extensions.

The Nightly and Developer Editions of Firefox based on 42 and above will retain the preference to disable signing enforcement, allowing the development and/or use of unsigned add-ons in those versions. Unbranded versions of Firefox based on releases will also be made available for developers, and are expected to be in place for Firefox 42 for release (and potentially beta).