设置xpinstall.signatures.required为false将不适用于 Mac 或 Windows 上的 Beta 或 Release 版本的 Firefox。这样做没有效果。在 Linux 上,根据您的发行版,该设置可能会得到遵守,并且在 Firefox 发行版的某些发行版上确实有效。
/*Enable userChrome.js */
/* Copyright (c) 2017 Haggai Nuchi
Available for use under the MIT License:
https://opensource.org/licenses/MIT
*/
@namespace url(http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul);
toolbarbutton#alltabs-button {
-moz-binding: url("userChrome.xml#js");
}
<?xml version="1.0"?>
<!-- Copyright (c) 2017 Haggai Nuchi
Available for use under the MIT License:
https://opensource.org/licenses/MIT
-->
<!-- This has been modified from the version available from
https://github.com/nuchi/firefox-quantum-userchromejs/blob/master/userChrome.xml
to include code by Makyen to disable add-on signing. If you want to load an additional JavaScript
file of your own, please see the original file by Haggai Nuchi.
This modified version is released under both the MIT and CC BY-SA 3.0 licenses.
-->
<bindings id="generalBindings"
xmlns="http://www.mozilla.org/xbl"
xmlns:xul="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
xmlns:xbl="http://www.mozilla.org/xbl">
<binding id="js" extends="chrome://global/content/bindings/toolbarbutton.xml#toolbarbutton-badged">
<implementation>
<constructor><![CDATA[
//Worked on FF65 and lower. The 3 different resources are used in different versions of FF.
try {
Components.utils.import("resource://gre/modules/addons/XPIProvider.jsm", {}).eval("SIGNED_TYPES.clear()");
} catch(e) {}
try {
Components.utils.import("resource://gre/modules/addons/XPIInstall.jsm", {}).eval("SIGNED_TYPES.clear()");
} catch(e) {}
try {
Components.utils.import("resource://gre/modules/addons/XPIDatabase.jsm", {}).eval("SIGNED_TYPES.clear()");
} catch(e) {}
//Tested on Firefox 66
try {
const {XPCOMUtils} = ChromeUtils.import("resource://gre/modules/XPCOMUtils.jsm");
XPCOMUtils.defineLazyModuleGetters(this, {
XPIDatabase: "resource://gre/modules/addons/XPIDatabase.jsm",
});
XPIDatabase.SIGNED_TYPES.clear();
console.log('Add-on signing disabled.');
} catch(e) {
console.error(e);
}
]]></constructor>
</implementation>
</binding>
</bindings>
After adding these two files in your profile's chrome directory, you will need to restart Firefox. You can verify that the code is running by looking for "Add-on signing disabled." in the Browser Console (in FF66+; the console output may not be displayed in earlier versions of Firefox).
Add-ons which were disabled or removed by Firefox may not be automatically enabled. You may need to re-install them, or at least manually enable them from about:addons. You can install them by draging-and-droping the *.xpi file onto a Firefox window and confirming that you want to install, or going to the add-on's page on Mozilla Add-ons.
If you are wanting to get the *.xpi file for any particular extension from Mozilla Add-ons you can download it by right clicking on the "install" button and selecting "Save As", or "Remove".
Unfortunately, I don't recall with which version of Firefox this method stopped working. I know I was using it on Firefox 54, 55, 52ESR and FF56.*.
I initially found this solution for disabling forced add-on signature checking in this blog post, which is the original source for the (somewhat modified) code in this answer. Making these changes will allow you to install unsigned add-ons into profiles using the Firefox distribution you modify. For most people, this will be your main Firefox installation. However, if you have installed multiple versions, you will need to make this modification in each installation. However, once you make the modifications, they will remain through normal Firefox updates.
You then need to add code below as the file <Install directory>/defaults/pref/disable-add-on-signing-prefs.js (Windows: <Install directory>\defaults\pref\disable-add-on-signing-prefs.js):
//This file should be placed in the defaults/pref directory (folder)
//within the Firefox installation directory with the with the name:
// disable-add-on-signing-prefs.js
pref("general.config.obscure_value", 0);
pref("general.config.filename", "disable-add-on-signing.js");
Add second file
You also need to add the code below as the file <Install directory>/disable-add-on-signing.js (Windows: <Install directory>\disable-add-on-signing.js):1
//This file should be placed in the Firefox installation directory
//(folder) with the with the name:
// disable-add-on-signing.js
try {
Components.utils.import("resource://gre/modules/addons/XPIProvider.jsm", {})
.eval("SIGNED_TYPES.clear()");
} catch(e) {}
try {
Components.utils.import("resource://gre/modules/addons/XPIInstall.jsm", {})
.eval("SIGNED_TYPES.clear()");
} catch(e) {}
Results
With the current release version of Firefox, I've been using this solution for a while now to have a few extensions I built for my own use installed and to test new versions of extensions I'm working on (when I want to test in the Release version instead of Firefox Developer Edition or Nightly).
NOTE: In about:addons Firefox may show (under some conditions) the add-on as enabled (not greyed-out), but have text stating that the add-on "could not be verified and has been disabled". The text is not accurate! The add-on is enabled and functioning.
How it works
[This is an explanation of older code, but the current code is very similar.]
Within resource://gre/modules/addons/XPIProvider.jsm the const SIGNED_TYPES is defined as a Set. In order for an add-on to require signing, its type must be a member of that Set. The Set.prototype.clear() method is used to clear all entries from the Set. This results in no add-on types which require signing (code 1, code 2).
If you wanted to, you could individually disable the signature check for any of the types: "webextension", "extension", "experiment", or "apiextension".
I found another way to get the hotfix. It's the same fix as above, but tinkering with settings trying to get Studies to download failed to get it on my machine. I found a GitHub issue that described yet another way to install the hotfix
Upon doing so my plugins immediately began working again. I don't know if you have to have studies enabled first or not (I had mine enabled). I also don't show it in extensions or the studies window, so just be aware you may not be able to disable it (possibly until Studies updates on its own).
Update: My browser finally pulled the studies feed and the hotfix shows in about:studies (put it in your URL bar to see all studies), where you can indeed remove it. So all this does is get the fix into Firefox faster, but be sure to enable studies as outlined in Makyen's answer
Although accepted answer mentions before-quantum versions (FF <57), it did not work for me(I'm using firefox ESR-52.9). After some hours of research I managed to fix the issue. Here is how I did:
abstract
In abstract, the solution has 3 steps:
get renewed certificate
install renewed certificate
reset add-on status
of course you should make your profile backup before proceed.
extract it(.xpi is just .zip), and open {extracted folder}/experiments/skeleton/api.js inside.
from the .js file, copy base64-encoded intermediate cert and paste into new text file. the cert looks like below. just copy double-quoted("") string (the MII... thing)
let intermediate = "MII...
decode base64-encoded cert and save as .der cert.
go to options-advanced-certificates-Authorities and install the cert as CA. trust it to identify software developers.
To provide this fix on short notice, we are using the Studies system.
This system is enabled by default, and no action is needed unless
Studies have been disabled. Firefox users can check if they have
Studies enabled by going to:
Firefox Options/Preferences -> Privacy & Security -> Allow Firefox to install and run studies (scroll down to find the setting)
问题
Mozilla 用于签署附加组件的中间签名证书已过期。这会导致 Firefox 将使用该证书签名的附加组件视为不受信任。该问题正在Bugzilla 1548973和Mozilla 的博客中进行跟踪。
解决方案 0:将 Firefox 更新到 66.0.5+ 或 60.6.3+ ESR
Mozilla 已发布适用于桌面和 Android 的 Firefox 66.0.5和60.6.3 ESR,“其中包括用于重新启用从 5 月 3 日起禁用的附加组件的永久修复程序。 ”建议您将 Firefox 更新到最新版本. 该更新取代了研究,这意味着如果您只启用“研究”来获得此修复,则可以在更新到当前版本的 Firefox 后再次禁用它们。
对于不选择更新到当前版本的 Firefox 或 Firefox ESR 的任何人,Mozilla 计划发布适用于 Firefox 52 到 65 版本的更新。计划是它将成为用户可安装的扩展。期望他们会在有更多信息可用时更新他们的博客文章。这是截至美国东部时间 5 月 8 日 19:28 可用的所有信息。
要在 Windows 或 MacOS 上更新您的 Firefox 版本,请单击右上角的菜单,然后选择“帮助”,然后选择“关于 Firefox”。然后应该会自动下载更新,并在您重新启动 Firefox 时应用。
并非所有 Linux 上的包管理器都发布了新版本。如果您的发行版的包管理器没有可用的更新,那么您可能不得不求助于手动更新(使用您的首选方法)或尝试以下解决方案之一。
解决方案 0.5:对于那些不想更新的人
截至 2019-05-14,Mozilla 的博客列出了可以为不想更新的旧版本 Firefox 用户安装的扩展(强调已添加):
解决方案 1:大多数桌面用户的自动解决方案:“研究”
[注意:以下修复要求您启用“研究”,这允许 Mozilla 自动下载代码以在受影响的配置文件中在 Firefox 上运行(大多数用户只有一个配置文件)。此外,它要求您启用“允许 Firefox 将技术和交互数据发送到 Mozilla”。如果您出于隐私考虑而关闭了这些功能,则应考虑是否要这样做。您不必启用这些设置,但您确实需要启用它们以允许运行解决此问题的研究。对于那些不想向 Mozilla 启用“研究”和数据报告的人,请参阅解决方案 3(下面;默认情况下,解决方案 2 会将数据发送给 Mozilla,有时还会向其合作伙伴发送数据)。不会打开向 Mozilla 报告,但我还没有对此进行测试。]
如果您启用了“Studies”,Mozilla 已针对 Release、Beta 和 Nightly 桌面用户的问题进行了修复。来自Mozilla 的博客,由Kev Needham撰写,在CC BY-SA 3.0下获得许可:
Mozilla 正在开发不需要研究系统的修复程序。他们知道一些用户报告说,即使安装了上述两项研究,他们的扩展仍然被禁用。该问题正在错误 1549078中进行跟踪。
更快地安装研究
如果您启用了研究,Firefox 最多可能需要 6 个小时来检查这些新研究。
备选方案 1:将 Firefox 设置为更快地检查研究
用户 David 在博客的评论中提出以下建议,以使 Firefox 更快地检查研究:
我建议你不要将它设置在
60
几秒以下。可以肯定的是,自上次 Firefox 检查研究以来已经超过 1 分钟,或者您已经安装了研究。使用像 60 这样的数字将为您提供足够的时间来安装研究并将数字设置回21600
,而无需让 Firefox 持续检查研究。只要准备好在安装研究后将其更改回21600
,然后再次重新启动 Firefox。备选方案 2:(不工作)创建启用研究的新配置文件并将研究复制到您的主配置文件
我尝试从另一个配置文件复制研究/修补程序。手动将研究/修补程序文件添加到另一个配置文件不起作用。以这种方式加载时,它被识别为常规扩展。但是,它似乎使用了 WebExtension Experiments,在 Firefox 的发行版中没有为普通扩展启用它。
配置文件目录中的配置文件很可能可以修改以使其工作(它们主要是 JSON)。但是,我没有深入研究它以弄清楚需要什么。
备选方案 3:直接下载研究
看来您可以通过直接转到用于下载它的 URL 来直接安装主要的“研究”。我第一次看到 [email protected] 的 URL 是在Samuel Vuorela在Mozilla 的博客文章中发表的评论中。
Machavity 在这个问题上有一个答案,描述了他从那个 URL 下载研究的经历,并更详细地描述了在 Mozilla 的研究提要中可以找到该 URL 的位置。正是他的回答让我尝试直接下载它,所以如果您发现直接安装 URL 有帮助,那么给他的回答投赞成票是合适的。在该回答中描述了虽然直接下载/安装研究 *.xpi 文件是有效的,但这样做不会导致修补程序显示在研究列表或附加组件列表中。如果 Firefox 稍后通过其研究更新下载它,它将显示为一项研究。
上述 URL 的下载内容与通过正常“研究”提要安装后存储在扩展目录中的 [email protected] 文件完全匹配。查看浏览器控制台表明直接从下载安装不会出现与从以前下载的副本手动安装 *.xpi 相同的问题(即它没有通过替代 2 安装它的相同问题非-功能)。
解决方案 2:使用 Developer Edition 或 Nightly 并禁用签名检查(在 Debian 和 Ubuntu 16.04 以及 Firefox 版本 66.0.3 中也报告功能正常)
如果您安装Firefox Developer Edition或Firefox Nightly,
about:config
您可以设置xpinstall.signatures.required
为false
. 这将禁用扩展签名测试。Firefox Nightly 是 Firefox 开发前沿的夜间构建。仅当您愿意忍受任何可能存在的错误时才推荐使用。
Developer Edition 和 Nightly 都将“数据发送给 Mozilla —— 有时是我们 [Mozilla 的] 合作伙伴 —— 以帮助我们 [Mozilla] 处理问题并尝试想法。了解共享的内容。”
Firefox 允许您在一台机器上同时安装多个版本的 Firefox。就个人而言,我安装了几个版本。一个相当简单的解决方案是安装 Developer Edition 并将其设置
xpinstall.signatures.required
为false
. 然后您可以使用 Developer Edition 几天,直到 Mozilla 弄清楚并修复整个问题。然后,您只需运行该版本即可返回使用 Firefox 的 Release 版本。设置
xpinstall.signatures.required
为false
将不适用于 Mac 或 Windows 上的 Beta 或 Release 版本的 Firefox。这样做没有效果。在 Linux 上,根据您的发行版,该设置可能会得到遵守,并且在 Firefox 发行版的某些发行版上确实有效。解决方案 3:禁用 Release/beta 版本的签名检查
首选的解决方案是使用上面提到的“研究”。但是,如果这对您不起作用,您可以通过禁用签名检查来解决此问题。
签名检查是一项安全功能。禁用它会降低 Firefox 的安全性。一旦 Mozilla 解决了他们的证书问题,建议您删除此代码以重新启用签名检查。安装此代码以禁用签名检查后,您应该小心只安装您完全信任的扩展(例如,托管在Mozilla Add-ons上的扩展)。
注意:此答案的其余部分最初是从我对如何禁用 Firefox 附加组件的签名检查?在 Stack Overflow 上,但已经做了一些修改。
在 Firefox 的发布(所有)版本中禁用附加签名检查
Firefox 版本 66+(可能是 60+)
以下说明将禁用 Firefox 上安装文件的 Firefox 配置文件的签名检查。您将向Firefox Profile 目录下的chrome目录添加一些文件。
我已经在 Firefox 66.0.3+ 上测试过了。
从 Firefox 69+ 开始,除了下面的说明之外,您还
toolkit.legacyUserProfileCustomizations.stylesheets
需要true
在about:config
. 如果它不存在,那么您将需要创建它(右键单击上下文菜单中的“新建”)作为布尔选项。有关添加此选项的更多详细信息,请参阅Bugzilla 1541233。IIRC,Firefox 65 需要一些略有不同的代码。我相信我在为 Firefox 66 修改它时将该代码留在
try
/catch
块中,但我不确定。javascript.enabled
如果您设置为false
in ,这将不起作用about:config
。该配置选项的默认值为true
,因此除非您特别禁用它,否则它应该没问题。我们将使用一种技术,允许您从存储在 Firefox 配置文件目录中的文件在浏览器上下文中运行任意 JavaScript 代码。我从Haggai Nuchi 的 GitHub 存储库中找到了如何执行此操作:Firefox Quantum compatible userChrome.js 。此代码在 Firefox 启动时运行一次,然后在每次打开新窗口时再次运行。
在 Windows 上,您的 Firefox 配置文件目录将为
%appdata%\Mozilla\Firefox\Profiles\[profileID]
. 如果您只有一个配置文件,则[profileID]
该目录将是目录中的唯一%appdata%\Mozilla\Firefox\Profiles
目录。如果您有多个配置文件,则需要选择要将此 hack 安装到的配置文件。到达您的配置文件目录后,您将需要创建一个名为 的目录(
chrome
如果该目录尚不存在)。您将以下 2 个文件添加到该目录:userChrome.css
userChrome.xml
然后,您将需要 中的以下代码
userChrome.css
,可从 Haggai Nuchi 的 GitHub 存储库中获得:您将需要(从Haggai Nuchi 的 GitHub 存储库中提供的版本
userChrome.xml
稍作修改):After adding these two files in your profile's chrome directory, you will need to restart Firefox. You can verify that the code is running by looking for "Add-on signing disabled." in the Browser Console (in FF66+; the console output may not be displayed in earlier versions of Firefox).
Add-ons which were disabled or removed by Firefox may not be automatically enabled. You may need to re-install them, or at least manually enable them from
about:addons
. You can install them by draging-and-droping the *.xpi file onto a Firefox window and confirming that you want to install, or going to the add-on's page on Mozilla Add-ons.If you are wanting to get the *.xpi file for any particular extension from Mozilla Add-ons you can download it by right clicking on the "install" button and selecting "Save As", or "Remove".
Firefox version < 57 (or so)
If you have problems with FF<57, please see my answer to "How can I disable signature checking for Firefox add-ons?" on Stack Overflow. I believe I've incorporated everything from the comments on that question, but the comments describe some problems that other people encountered.
Unfortunately, I don't recall with which version of Firefox this method stopped working. I know I was using it on Firefox 54, 55, 52ESR and FF56.*.
I initially found this solution for disabling forced add-on signature checking in this blog post, which is the original source for the (somewhat modified) code in this answer. Making these changes will allow you to install unsigned add-ons into profiles using the Firefox distribution you modify. For most people, this will be your main Firefox installation. However, if you have installed multiple versions, you will need to make this modification in each installation. However, once you make the modifications, they will remain through normal Firefox updates.
You will need to add a couple of files within the Firefox installation directory. You can find a list of installation directory examples for Windows, Linux, and Mac OS on mozillaZine. The most common install directories are:
Add first file
You then need to add code below as the file
<Install directory>/defaults/pref/disable-add-on-signing-prefs.js
(Windows:<Install directory>\defaults\pref\disable-add-on-signing-prefs.js
):Add second file
You also need to add the code below as the file
<Install directory>/disable-add-on-signing.js
(Windows:<Install directory>\disable-add-on-signing.js
):1Results
With the current release version of Firefox, I've been using this solution for a while now to have a few extensions I built for my own use installed and to test new versions of extensions I'm working on (when I want to test in the Release version instead of Firefox Developer Edition or Nightly).
NOTE: In
about:addons
Firefox may show (under some conditions) the add-on as enabled (not greyed-out), but have text stating that the add-on "could not be verified and has been disabled". The text is not accurate! The add-on is enabled and functioning.How it works
[This is an explanation of older code, but the current code is very similar.]
Within
resource://gre/modules/addons/XPIProvider.jsm
theconst SIGNED_TYPES
is defined as aSet
. In order for an add-on to require signing, its type must be a member of thatSet
. TheSet.prototype.clear()
method is used to clear all entries from theSet
. This results in no add-on types which require signing (code 1, code 2).If you wanted to, you could individually disable the signature check for any of the types:
"webextension"
,"extension"
,"experiment"
, or"apiextension"
.中间代码签名证书已过期。这意味着所有使用证书签名的附加组件都不再受信任。在这种情况下,浏览器正在执行它的工作。
Mozilla 将需要退出附加组件和/或推出新证书。修复工作正在进行中。目前没有解决方案,除非您位于可以进入
about:config
并设置xpinstall.signatures.required
为的开发人员代码分支上false
。这对大多数用户不起作用,如果您不将其设置回去,可能会使您面临一些安全风险。最好的选择是等待。我想他们会在几个小时内解决这个问题。
https://bugzilla.mozilla.org/show_bug.cgi?id=1548973
此问题是由于附加证书大量过期造成的。正如其他人所提到的,修复工作正在进行中。
要暂时重新启用加载项,您可以导航到
about:config
并将其设置xpinstall.signatures.required
为 false。这将重新启用任何已安装的已过期证书的附加组件,但不建议长期保持启用状态。我建议在问题解决后立即将其关闭。
I found another way to get the hotfix. It's the same fix as above, but tinkering with settings trying to get Studies to download failed to get it on my machine. I found a GitHub issue that described yet another way to install the hotfix
Upon doing so my plugins immediately began working again. I don't know if you have to have studies enabled first or not (I had mine enabled). I also don't show it in extensions or the studies window, so just be aware you may not be able to disable it (possibly until Studies updates on its own).
Update: My browser finally pulled the studies feed and the hotfix shows in
about:studies
(put it in your URL bar to see all studies), where you can indeed remove it. So all this does is get the fix into Firefox faster, but be sure to enable studies as outlined in Makyen's answerAlthough accepted answer mentions before-quantum versions (FF <57), it did not work for me(I'm using firefox ESR-52.9). After some hours of research I managed to fix the issue. Here is how I did:
abstract
In abstract, the solution has 3 steps:
of course you should make your profile backup before proceed.
details
download hotfix from mozilla. https://storage.googleapis.com/moz-fx-normandy-prod-addons/extensions/[email protected]
extract it(.xpi is just .zip), and open {extracted folder}/experiments/skeleton/api.js inside.
from the .js file, copy base64-encoded intermediate cert and paste into new text file. the cert looks like below. just copy double-quoted("") string (the MII... thing)
decode base64-encoded cert and save as .der cert.
go to options-advanced-certificates-Authorities and install the cert as CA. trust it to identify software developers.
打开您的个人资料页面并删除 extensions.json、extensions.ini。 注意:它会重置您的附加组件启用/安装状态!在执行此步骤之前备份您的配置文件。
重新启动 FF 并检查问题是否已解决。
The update to fix this should get pushed automatically. If it doesn't, ensure the option to allow Firefox to install and run studies is enabled.
Copied from https://blog.mozilla.org/addons/2019/05/04/update-regarding-add-ons-in-firefox/