Mozilla Add-Ons拒绝jQuery(尽管没有被修改) [英] Mozilla Add-Ons rejecting jQuery (despite not being modified)

查看:130
本文介绍了Mozilla Add-Ons拒绝jQuery(尽管没有被修改)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

(请注意,这是针对我遇到的问题的自答案Q& A)

尝试提交WebExtension后对于Mozilla Add-Ons的公开列表,提交内容被评论者拒绝,并提供以下消息:

After trying to submit a WebExtension to Mozilla Add-Ons for public listing, the submission was rejected by a reviewer with the following message:


您的加载项包含一个JavaScript库文件与我们已知的任何版本都不匹配。我们要求所有加载项都使用未修改的发行版本。

Your add-on includes a JavaScript library file that doesn't match any versions known to us. We require all add-ons to use unmodified release versions.

我们接受从'ajax.googleapis.com','jquery.com'下载的JQuery / JQuery-UI库或'jqueryui.com';并且未经任何修改即使用(已下载且未复制粘贴)。缩小版本更好。 (文件名更改无关紧要)

We accept JQuery/JQuery-UI libraries downloaded from 'ajax.googleapis.com', 'jquery.com' or 'jqueryui.com'; and used without any modification (downloaded and not copy pasted). Minified versions are better. (file-name change does not matter)

对不起,我们无法接受修改,重新配置或自定义的库。

I'm sorry, but we cannot accept modified, re-configured or customized libraries.

同一问题的另一个症状:来自jQuery的初始验证中的几个对innerHTML的不安全分配警告。

Another symptom of the same problem: several "Unsafe assignment to innerHTML" warnings on initial validation coming from jQuery.

但是,相关文件确实是作为发布版本下载的来自jquery.com的缩小版本并没有故意修改。那么发生了什么?

推荐答案

原来,即使你不手动修改文件,你也可以遇到 git 为你做的事情。

Turns out, even if you don't manually modify files, you can run into a situation when git does it for you.

具体来说,CRLF行结尾的自动处理正在修改jQuery的缩小文件,导致匹配失败i n以下情况:

Specifically, automatic handling of CRLF line endings was modifying the jQuery's minified file, resulting in failed matching in the following situation:


  • 将jQuery下载到回购邮件中。

  • 提交文件:行结尾可能会在此时进行修改。

  • 为AMO建立档案;由于文件被修改,它在审查中被拒绝。

为了防止这种情况发生,可以将jQuery文件标记为二进制,以便Git可以在任何情况下都不要触摸它们,无论特定机器/回购上的设置如何。

To prevent this happening, one can mark jQuery files as binary so that Git does not touch them under any circumstances, regardless of settings on a particular machine/repo.


  1. 添加 .gitattributes 文件夹中的某个位置,直到jQuery所在的位置,并假设 jquery.min.js 是文件名:

  1. Add a .gitattributes file somewhere in the chain of folders up to where jQuery is located, and assuming jquery.min.js is the filename:

jquery.min.js -text


  • 用新下载的jQuery替换jQuery的副本,并与 .gitattributes 一起提交。

    为所有缩小的库做这个可能是个好主意。

    It might be a good idea to do it for all minified libraries.

    如果图书馆版本已被识别,验证将显示以下通知:

    If the library version is recognized, verification will show the following notice:

    这篇关于Mozilla Add-Ons拒绝jQuery(尽管没有被修改)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

  • 查看全文
    相关文章
    登录 关闭
    扫码关注1秒登录
    发送“验证码”获取 | 15天全站免登陆