{"id":7688,"date":"2016-02-24T15:28:31","date_gmt":"2016-02-24T23:28:31","guid":{"rendered":"http:\/\/blog.mozilla.org\/addons\/?p=7688"},"modified":"2016-02-24T15:34:19","modified_gmt":"2016-02-24T23:34:19","slug":"quicker-reviews-with-sources-attached","status":"publish","type":"post","link":"https:\/\/blog.mozilla.org\/addons\/2016\/02\/24\/quicker-reviews-with-sources-attached\/","title":{"rendered":"How to get a quicker review for add-ons with source code attached"},"content":{"rendered":"<p>When submitting an add-on to addons.mozilla.org (AMO), it is sometimes necessary to attach source code in addition to the xpi file. This usually applies to add-ons with obfuscated code, because a reviewer wouldn\u2019t be able to approve an add-on without reviewing what was obfuscated. Since these types of add-ons are more complex to review, I\u2019ve written some tips on what you can do to help them get through the queue faster.<\/p>\n<h4><b>When to attach sources<\/b><\/h4>\n<p>When the add-on xpi file you upload to addons.mozilla.org (AMO) contains code that is not completely readable by a human, it is probably a good idea to attach sources.<\/p>\n<p>For example, if you used tools like<a href=\"https:\/\/github.com\/mishoo\/UglifyJS2\"> uglifyJS<\/a>,<a href=\"https:\/\/developers.google.com\/closure\/compiler\/\"> Google Closure Compiler<\/a>, <a href=\"http:\/\/browserify.org\/\">browserify<\/a> or a custom pre-processor, you will have to upload sources. The same goes if you are using js-ctypes or including other binary components.<\/p>\n<p>There are also a few cases where it is actually NOT required and in fact not recommended. If your library only contains third-party minified libraries (like jQuery or Angular), or if the libraries you are calling via js-ctypes are system libraries or open source, please do not upload sources. Instead, provide links to the repositories of the respective libraries.<\/p>\n<h4><b>What happens during reviews<\/b><\/h4>\n<p>When you attach sources, the add-on is marked for &#8220;admin-review&#8221;. This means that your sources and are only accessible to a small group of admins. We do this to protect your sources.<\/p>\n<p>A very important aspect of reviewing sources is reproducing the obfuscation. As we need to treat every extension developer the same, we must verify that the source code we reviewed matches the uploaded xpi. If we skip this step, a malware author could provide us with legitimate-looking sources and add a backdoor to the previously minified xpi file.<\/p>\n<p>Here are the steps we take:<\/p>\n<ol>\n<li>Download the sources and extract them.<\/li>\n<li>Run <i>&lt;magic steps&gt;<\/i>, including minifiers, obfuscators, compilers, or code generators.<\/li>\n<li>Take the output directory from the previous step and compare it with the add-on xpi that has been uploaded.<\/li>\n<li>Review the source code files as we would review any other add-on that does not have sources.<\/li>\n<\/ol>\n<p>In step 3, we use a diff tool to compare the generated sources to the add-on xpi file. There must be no differences at all. To save time, it is very important to provide us with all the <i>&lt;magic steps&gt;<\/i>. If you don\u2019t add this, we will have to get in touch with you, and that adds time to the review process.<\/p>\n<h4><b>Providing instructions<\/b><\/h4>\n<p>The easiest way for you to provide the magic steps is to include a <code>README<\/code> file in the uploaded sources. If it is just one or two files that are obfuscated, the instructions can be something like &#8220;run uglifyjs data\/mycoolstuff.js&#8221;. If the extension is any more complex, please provide a script that we can run that takes care of everything at once. Things you should mention in your <code>README<\/code> include:<\/p>\n<ul>\n<li>Prerequisites that need to be downloaded separately, for example<a href=\"http:\/\/yui.github.io\/yuicompressor\/\"> yuicompressor<\/a>.<\/li>\n<li>For less popular or custom-written build tools, provide links where they can be downloaded, as well as installation steps.<\/li>\n<li>If a specific version of supplemental software needs to be used, please let us know. But avoid doing so if the latest version would work just as well.<\/li>\n<li>All commands we should run to go from sources to a generated xpi file that matches the one you&#8217;ve uploaded, for example <code>npm install<\/code> or a grunt target.<\/li>\n<\/ul>\n<p>Please assume the reviewer has a vanilla operating system set up. You don\u2019t need to describe how to install common tools including npm, node, the add-on SDK, but please make sure the reviewer can figure out how to install everything needed to generate the xpi file.<\/p>\n<p>Aside from the <code>README<\/code> file, you also need to package everything required to build. If your add-on depends on a private repository or frameworks not commonly available, please include them as well.<\/p>\n<h4><b>Desired outcome<\/b><\/h4>\n<p>Common build tools used are<a href=\"https:\/\/www.gnu.org\/software\/make\/\"> make<\/a>,<a href=\"http:\/\/gruntjs.com\/\"> grunt<\/a>,<a href=\"http:\/\/gulpjs.com\/\"> gulp<\/a> and<a href=\"http:\/\/ant.apache.org\/\"> ant<\/a>. If you don&#8217;t already have a build target that runs the above steps, please add a target that does so. For example, allow us to run <code>grunt firefox-dist<\/code> to create the generated xpi. Here is an example of what the sources could look like. The <code>dist<\/code> directory is initially empty, until your build script (in this case grunt) generates the directory contents. You could then zip them up and upload them to AMO.<\/p>\n<pre style=\"line-height: 1em;\">sources\r\n\u251c\u2500\u2500 README.md                 \r\n\u251c\u2500\u2500 Gruntfile.js              \r\n\u251c\u2500\u2500 package.json               \r\n\u251c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 dist\r\n\u2502                                 \u251c\u2500\u2500 bootstrap.js\r\n\u2502                                 \u251c\u2500\u2500 install.rdf\r\n\u2502                                 \u251c\u2500\u2500 package.json\r\n\u251c\u2500\u2500 data                          \u251c\u2500\u2500 data\r\n\u2502   \u251c\u2500\u2500 js                        \u2502   \u251c\u2500\u2500 js\r\n\u2502   \u2502   \u251c\u2500\u2500 dialog.js             \u2502   \u2502   \u251c\u2500\u2500 dialog.min.js\r\n\u2502   \u2502   \u2514\u2500\u2500 popup.js              \u2502   \u2502   \u2514\u2500\u2500 popup.min.js\r\n\u2502   \u251c\u2500\u2500 scss                      \u2502   \u251c\u2500\u2500 css\r\n\u2502   \u2502   \u251c\u2500\u2500 popup.scss            \u2502   \u2502   \u251c\u2500\u2500 popup.css\r\n\u2502   \u2502   \u251c\u2500\u2500 dialog.scss           \u2502   \u2502   \u2514\u2500\u2500 dialog.scss\r\n\u2502   \u2502   \u2514\u2500\u2500 common.scss           \u2502   \u2502\r\n\u2502   \u251c\u2500\u2500 html                      \u2502   \u251c\u2500\u2500 html\r\n\u2502   \u2502   \u251c\u2500\u2500 dialog.html           \u2502   \u2502   \u251c\u2500\u2500 dialog.html\r\n\u2502   \u2502   \u2514\u2500\u2500 popup.html            \u2502   \u2502   \u2514\u2500\u2500 popup.html\r\n\u2502   \u251c\u2500\u2500 vendor                    \u2502   \u251c\u2500\u2500 vendor\r\n\u2502   \u2502   \u2514\u2500\u2500 jquery-2.1.4.min.js   \u2502   \u2502   \u2514\u2500\u2500 jquery-2.1.4.min.js\r\n\u2502   \u2514\u2500\u2500 images                    \u2502   \u2514\u2500\u2500 images\r\n\u2502       \u2514\u2500\u2500 logo.png              \u2502       \u2514\u2500\u2500 logo.png\r\n\u251c\u2500\u2500 lib                           \u251c\u2500\u2500 lib\r\n\u2502   \u2514\u2500\u2500 main.js                   \u2502   \u2514\u2500\u2500 main.js\r\n\u2514\u2500\u2500 locale                        \u2514\u2500\u2500 locale\r\n    \u2514\u2500\u2500 en-US.properties              \u2514\u2500\u2500 en-US.properties<\/pre>\n<p>&nbsp;<\/p>\n<h4><b>A few more tips<\/b><\/h4>\n<p>If you can avoid obfuscating or minifying code, your review can be done by any reviewer. Should you still need to attach sources, make sure you provide clear instructions so that our admin reviewers can handle your add-on quickly. Responding to questions quickly and using well-known obfuscation tools also improve review time.<\/p>\n<h4><b>Some last words<\/b><\/h4>\n<p>While our reviewers, both volunteer and staff, review add-ons around the clock, there may be times when it just takes longer. This can be due to anything from Firefox releases and major product changes, to holiday seasons.<\/p>\n<p>I hope you\u2019ve found this post helpful. There\u2019s a lot to remember, but after you\u2019ve done this once or twice you should get the hang of it. If you\u2019d like a page to bookmark that contains this information and some more details on the topic, please head over to our <a href=\"https:\/\/developer.mozilla.org\/en-US\/Add-ons\/Source_Code_Submission\">new article on MDN<\/a>.<\/p>\n<p>If you also have tips to share, or questions on this topic, please post in our <a href=\"https:\/\/discourse.mozilla-community.org\/c\/add-ons\">forums<\/a>. Also, if you ever want to sit with developers on the other side of the table, perhaps consider<a href=\"https:\/\/wiki.mozilla.org\/AMO:Editors\/Applying\"> applying to become an add-on reviewer<\/a>?<\/p>\n","protected":false},"excerpt":{"rendered":"<p>When submitting an add-on to addons.mozilla.org (AMO), it is sometimes necessary to attach source code in addition to the xpi file. This usually applies to add-ons with obfuscated code, because &hellip; <a class=\"go\" href=\"https:\/\/blog.mozilla.org\/addons\/2016\/02\/24\/quicker-reviews-with-sources-attached\/\">Read more<\/a><\/p>\n","protected":false},"author":333,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[44,295,574],"tags":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v22.5 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>How to get a quicker review for add-ons with source code attached - Mozilla Add-ons Community Blog<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/blog.mozilla.org\/addons\/2016\/02\/24\/quicker-reviews-with-sources-attached\/\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Philipp Kewisch\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"5 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/blog.mozilla.org\/addons\/2016\/02\/24\/quicker-reviews-with-sources-attached\/\",\"url\":\"https:\/\/blog.mozilla.org\/addons\/2016\/02\/24\/quicker-reviews-with-sources-attached\/\",\"name\":\"How to get a quicker review for add-ons with source code attached - Mozilla Add-ons Community Blog\",\"isPartOf\":{\"@id\":\"https:\/\/blog.mozilla.org\/addons\/#website\"},\"datePublished\":\"2016-02-24T23:28:31+00:00\",\"dateModified\":\"2016-02-24T23:34:19+00:00\",\"author\":{\"@id\":\"https:\/\/blog.mozilla.org\/addons\/#\/schema\/person\/1a411fff670ed351fb643725ed5a34c0\"},\"breadcrumb\":{\"@id\":\"https:\/\/blog.mozilla.org\/addons\/2016\/02\/24\/quicker-reviews-with-sources-attached\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/blog.mozilla.org\/addons\/2016\/02\/24\/quicker-reviews-with-sources-attached\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/blog.mozilla.org\/addons\/2016\/02\/24\/quicker-reviews-with-sources-attached\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/blog.mozilla.org\/addons\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"How to get a quicker review for add-ons with source code attached\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/blog.mozilla.org\/addons\/#website\",\"url\":\"https:\/\/blog.mozilla.org\/addons\/\",\"name\":\"Mozilla Add-ons Community Blog\",\"description\":\"\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/blog.mozilla.org\/addons\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"en-US\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/blog.mozilla.org\/addons\/#\/schema\/person\/1a411fff670ed351fb643725ed5a34c0\",\"name\":\"Philipp Kewisch\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/blog.mozilla.org\/addons\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/c2d92d64a4b77306c45df1c9be647621?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/c2d92d64a4b77306c45df1c9be647621?s=96&d=mm&r=g\",\"caption\":\"Philipp Kewisch\"},\"description\":\"Twitter: @pkewisch\",\"sameAs\":[\"https:\/\/twitter.com\/pkewisch\",\"https:\/\/x.com\/pkewisch\"],\"url\":\"https:\/\/blog.mozilla.org\/addons\/author\/calendar\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"How to get a quicker review for add-ons with source code attached - Mozilla Add-ons Community Blog","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/blog.mozilla.org\/addons\/2016\/02\/24\/quicker-reviews-with-sources-attached\/","twitter_misc":{"Written by":"Philipp Kewisch","Est. reading time":"5 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/blog.mozilla.org\/addons\/2016\/02\/24\/quicker-reviews-with-sources-attached\/","url":"https:\/\/blog.mozilla.org\/addons\/2016\/02\/24\/quicker-reviews-with-sources-attached\/","name":"How to get a quicker review for add-ons with source code attached - Mozilla Add-ons Community Blog","isPartOf":{"@id":"https:\/\/blog.mozilla.org\/addons\/#website"},"datePublished":"2016-02-24T23:28:31+00:00","dateModified":"2016-02-24T23:34:19+00:00","author":{"@id":"https:\/\/blog.mozilla.org\/addons\/#\/schema\/person\/1a411fff670ed351fb643725ed5a34c0"},"breadcrumb":{"@id":"https:\/\/blog.mozilla.org\/addons\/2016\/02\/24\/quicker-reviews-with-sources-attached\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/blog.mozilla.org\/addons\/2016\/02\/24\/quicker-reviews-with-sources-attached\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/blog.mozilla.org\/addons\/2016\/02\/24\/quicker-reviews-with-sources-attached\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/blog.mozilla.org\/addons\/"},{"@type":"ListItem","position":2,"name":"How to get a quicker review for add-ons with source code attached"}]},{"@type":"WebSite","@id":"https:\/\/blog.mozilla.org\/addons\/#website","url":"https:\/\/blog.mozilla.org\/addons\/","name":"Mozilla Add-ons Community Blog","description":"","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/blog.mozilla.org\/addons\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"en-US"},{"@type":"Person","@id":"https:\/\/blog.mozilla.org\/addons\/#\/schema\/person\/1a411fff670ed351fb643725ed5a34c0","name":"Philipp Kewisch","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/blog.mozilla.org\/addons\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/c2d92d64a4b77306c45df1c9be647621?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/c2d92d64a4b77306c45df1c9be647621?s=96&d=mm&r=g","caption":"Philipp Kewisch"},"description":"Twitter: @pkewisch","sameAs":["https:\/\/twitter.com\/pkewisch","https:\/\/x.com\/pkewisch"],"url":"https:\/\/blog.mozilla.org\/addons\/author\/calendar\/"}]}},"_links":{"self":[{"href":"https:\/\/blog.mozilla.org\/addons\/wp-json\/wp\/v2\/posts\/7688"}],"collection":[{"href":"https:\/\/blog.mozilla.org\/addons\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.mozilla.org\/addons\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.mozilla.org\/addons\/wp-json\/wp\/v2\/users\/333"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.mozilla.org\/addons\/wp-json\/wp\/v2\/comments?post=7688"}],"version-history":[{"count":0,"href":"https:\/\/blog.mozilla.org\/addons\/wp-json\/wp\/v2\/posts\/7688\/revisions"}],"wp:attachment":[{"href":"https:\/\/blog.mozilla.org\/addons\/wp-json\/wp\/v2\/media?parent=7688"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.mozilla.org\/addons\/wp-json\/wp\/v2\/categories?post=7688"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.mozilla.org\/addons\/wp-json\/wp\/v2\/tags?post=7688"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}