(Note, this is intended as self-answer Q&A for a problem I encountered)
After trying to submit a WebExtension to Mozilla Add-Ons for public listing, the submission was rejected by a reviewer with the following message:
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.
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.
Another symptom of the same problem: several "Unsafe assignment to innerHTML" warnings on initial validation coming from jQuery.
However, the file in question was indeed downloaded as a release, minified version from jquery.com and wasn't intentionally modified. So what happened?
Turns out, even if you don't manually modify files, you can run into a situation when git
does it for you.
Specifically, automatic handling of CRLF line endings was modifying the jQuery's minified file, resulting in failed matching in the following situation:
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.
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
Replace the copy of jQuery with a freshly downloaded one and commit it together with .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:
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With