Firefox 附加组件的最大版本未强制执行?

maxVersion of Firefox Add-on is not enforced?

我有一个 Firefox 附加组件(不是通过 AOD 分发的),它应该只在 Firefox 50 之前有效(在那个版本中),参见。此片段来自我的 install.rdf:

 <em:targetApplication>
   <Description>
     <em:id>{ec8030f7-c20a-464f-9b0e-13a3a9e97384}</em:id>
     <em:minVersion>35.0</em:minVersion>
     <em:maxVersion>50.0</em:maxVersion>
   </Description>
 </em:targetApplication>

我的意图是,当用户更新到 Firefox 51 时,此附加组件将自动禁用(至少在附加组件也更新之前)。但是,我注意到情况并非如此:即使在 Firefox 重新启动后(无论如何在更新期间发生),附加组件仍然处于活动状态。

我做的版本控制有问题吗?

maxVersion 属性 将被忽略,除非您还设置 strictCompatibility:

<em:strictCompatibility>true</em:strictCompatibility>

MDN says the following 关于 strictCompatibility:

A Boolean value indicating if the add-on should be enabled when the version of the application is greater than its max version. By default, the value of this property is false meaning that the compatibility checking will not be performed against the max version.

Usually, there is no need to restrict the compatibility: not all new releases will break your extension and, if it is hosted on AMO, you'll get notice several weeks in advance if a potential risk has been detected. Moreover, an extension being disabled, even for a short period, leads to a bad experience for the user. About the only time you should need to set this if your add-on does things that are likely to be broken by Firefox updates. You do not need to set this flag if your add-on has a binary component, since add-ons with binary components are always subject to strict compatibility checking (because binary components need to be rebuilt for every major application release anyway).

我已经更新了 targetApplication section of the Install Manifests page on MDN to state that strictCompatibility is required for maxVersion not to be ignored. While this interaction was stated in the strictCompatibility section,上面引用的文本不是仅检查 maxVersion.

需要的内容的人会发现的内容

我怀疑这种情况的发生是因为 instal.rdf 文件的演变以及 maxVersion 的处理方式随着时间的推移而演变。不幸的是,这导致了需要 属性、maxVersion 但被忽略的情况。

WebExtension 中的等价物是 "applications": {"strict_max_version": "50.*",strict_max_version 值对 WebExtensions 强制执行。