Giter Club home page Giter Club logo

amo-validator's Introduction

No Maintenance Intended

⚠️ This tool is now considered fully deprecated and is no longer maintained.

addons.mozilla.org Validator

It is still used on addons.mozilla.org for legacy add-ons but once support for updates for legacy add-ons goes away from AMO this tool will be archived.

The AMO Validator is a tool designed to scan Mozilla add-on packages for problems such as security vulnerabilities, exploits, spamware and badware, and lots of other gunk. By using a combination of various techniques and detection mechanisms, the validator is capable of being both efficient as well as thorough.

Setup

Prerequisites

You can install everything you need for running and testing with

pip install -r requirements.txt

Submodules

The validator may require some submodules to work. Make sure to run

git clone --recursive git://github.com/mozilla/amo-validator.git

so that you get all of the goodies inside.

Spidermonkey

A working copy of Spidermonkey (debug or non-debug is fine) is required. The easiest way to do this is to just download the binary.

If you want to build it from scratch, clone the mozilla-central repo or download the tip (which is faster). Then build it from source like this

cd mozilla-central
cd js/src
autoconf2.13
./configure
make
sudo cp dist/bin/js /usr/local/bin/js

You must use autoconf at exactly 2.13 or else it won't work. If you're using brew_ on Mac OS X you can get autoconf2.13 with this

brew install autoconf213

If you don't want to put the js executable in your $PATH or you want it in a custom path, you can define it as $SPIDERMONKEY_INSTALLATION in your environment.

Using amo-validator as a contained app using docker

Check this instructions from marceloandrader

Running

Run the validator as follows

./addon-validator <path to xpi> [-t <expected type>] [-o <output type>] [-v]
    [--boring] [--selfhosted] [--determined]

The path to the XPI should point to an XPI file.

-t
The type that you expect your add-on to be detected as. The list of types is listed below.
-o
The type of output to generate. Types are listed below.
-v
Enable verbose mode. Extra information will be displayed in verbose mode, namely notices (informational messages), Jetpack information if available, extra error info (like contexts, file data, etc.), and error descriptions. This only applies to `-o text`.
--selfhosted
Disables messages that are specific to add-ons hosted on AMO.
--boring
Disables colorful shell output.
--determined
Continue validating the remaining tiers of an add-on if one tier has failed. Certain high-tiered tests may inadvertently fail when this option is enabled for badly malformed add-ons.
--target-maxversion
Accepts a JSON string containing an object whose keys are GUIDs and values are version strings. This will override the max version that the add-on supports for the corresponding application GUID. E.g.: `{"{ec8030f7-c20a-464f-9b0e-13a3a9e97384}": "6.*"}`
--target-minversion
Identical to `--target-maxversion`, except overrides the min version instead of the max.
--for-appversions
Accepts a JSON string containing an object whose keys are GUIDs and values are lists of version strings. If this list is specified, non-inlinecompatibility tests will only be run if they specifically target the applications and veresions in this parameter. E.g.: `{"{ec8030f7-c20a-464f-9b0e-13a3a9e97384}": ["6.*"]}`

Expected Type:

The expected type should be one of the following values:

any (default)
Accepts any extension
extension
Accepts only extensions
theme
Accepts only themes
dictionary
Accepts only dictionaries
languagepack
Accepts only language packs
search
Accepts only OpenSearch XML files (unpackaged)
multi
Accepts only multi-item XPI packages

Specifying an expected type will throw an error if the validator does not detect that particular type when scanning. All addon type detection mechanisms are used to make this determination.

Output Type:

The output type may be either of the following:

text (default)
Outputs a textual summary of the addo-on analysis. Supports verbose mode.
json
Outputs a JSON snippet representing a full summary of the add-on analysis.

Output

Text Output Mode (default; text)

In text output mode, output is structured in the format of one message per line. The messages are prefixed by their priority level (i.e.: "Warning: This is the message").

At the head of the text output is a block describing what the add-on type was determined to be.

JSON Output Mode (json)

In JSON output mode, output is formatted as a JSON snippet containing all messages. The format for the JSON output is that of the sample document below.

{
    "detected_type": "extension",
    "errors": 2,
    "warnings": 1,
    "notices": 1,
    "success": false,
    "compatibility_summary": {
        "errors": 1,
        "warnings": 0,
        "notices": 0
    },
    "ending_tier": 4,
    "messages": [
        {
            "uid": "123456789",
            "id": ["module", "function", "error"],
            "type": "error",
            "message": "This is the error message text.",
            "description": ["Description of the error message.",
                            "Additional description text"],
            "file": ["chrome/foo.jar", "bar/zap.js"],
            "line": 12,
            "column": 50,
            "context": [
                "   if(foo = bar())",
                "       an_error_is_somewhere_on_this_line.prototy.eval(\"whatever\");",
                null
            ],
            "compatibility_type": "error",
            "for_appversions": {
                "{ec8030f7-c20a-464f-9b0e-13a3a9e97384}": ["5.0a2", "6.0a1"]
            },
            "tier": 2
        }
    ],
    "metadata": {
        "name": "Best Add-on Evar",
        "version": "9000",
        "guid": "[email protected]"
    }
}

JSON Notes:

File Hierarchy

When a subpackage exists, an angle bracket will delimit the subpackage name and the message text.

If no applicable file is available (i.e.: when a file is missing), the file value will be empty. If a file value is available within a subpackage, then the file attribute will be a list containing the name of the outermost subpackage's name, followed by each successive concentric subpackage's name, followed by the name of the file that the message was generated in. If no applicable file is available within a subpackage, the file attribute is identical, except the last element of the list in the file attribute is an empty string.

For instance, this tree would generate the following messages:

package_to_test.xpi
    |
    |-install.rdf
    |-chrome.manifest
    |-subpackage.xpi
    |  |
    |  |-subsubpackage.xpi
    |     |
    |     |-chrome.manifest
    |     |-install.rdf
    |
    |-subpackage.jar
       |
       |-install.rdf
[
    {
        "type": "notice",
        "message": "<em:type> not found in install.rdf",
        "description": " ... ",
        "file": "install.rdf",
        "line": 0
    },
    {
        "type": "error",
        "message": "Invalid chrome.manifest subject: override",
        "description": " ... ",
        "file": "chrome.manifest",
        "line": 7
    },
    {
        "type": "error",
        "message": "subpackage.xpi > install.rdf missing from theme",
        "description": " ... ",
        "file": ["subpackage.xpi", ""],
        "line": 0
    },
    {
        "type": "error",
        "message": "subpackage.xpi > subsubpackage.xpi > Invalid chrome.manifest subject: sytle",
        "description": " ... ",
        "file": ["subpackage.xpi", "subsubpackage.xpi", "chrome.manifest"],
        "line": 5
    }
]
Line Numbers and Columns

Line numbers are 1-based. Column numbers are 0-based. This can be confusing from a programmatic standpoint, but makes literal sense. "Line one" would obviously refer to the first line of a file.

Contexts

The context attribute of messages will either be a list or null. Null contexts represent the validator's inability to determine surrounding code. As a list, there will always be three elements. Each element represents a line surrounding the message's location.

The middle element of the context list represents the line of interest. If an element of the context list is null, that line does not exist. For instance, if an error is on the first line of a file, the context might look like:

[
    null,
    "This is the line with the error",
    "This is the second line of the file"
]

The same rule applies for the end of a file and for files with only one line.

Testing

Tests can be run with

py.test tests/

Functional tests, which take longer, can be run with

py.test functional_tests/

Then make a cup of tea while all of those tests run. It takes a while. If you have more than two cores on your machine or you don't mind pwnage, you can try to increase the number of parallel processes used for testing.

Releasing

Follow these steps to release a new version of the amo-validator Python package:

  1. Increment the __version__ attribute at the top of ./validator/__init__.py.
  2. Commit your change to the master branch and run git push.
  3. Tag master with the new version number, such as git tag 1.9.8.
  4. Push the new tag with git push --tags
  5. TravisCI will build and release a new version of amo-validator to PyPI from your tag commit. Here is an example.

Updating

Some regular maintenance needs to be performed on the validator in order to make sure that the results are accurate.

App Versions

A list of Mozilla <em:targetApplication> values is stored in the validator/app_versions.json file. This must be updated to include the latest application versions. This information can be found on AMO:

https://addons.mozilla.org/en-US/firefox/pages/appversions/

JS Libraries

Lists of JS library hashes are kept to allow for whitelisting or warning. These must be regenerated with each new library version. To update:

python extras/update_hashes.py

To add new libraries to the mix, edit extras/jslibfetcher.py and add the version number to the appropriate tuple.

Jetpack

In order to maintain Jetpack compatibility, the whitelist hashes need to be regenerated with each successive Jetpack version. To rebuild the hash library, simply run:

cd jetpack
./generate_jp_whitelist.sh

That's it!

Language Packs

With every version of every app that's released, the language pack references need to be updated.

We now have an automated tool to ease this tedious process. It is currently designed to work on OS X with the OS X versions of Mozilla applications, though it could conceivably run on any *NIX platform against the OS X application packages.

To run the tool, first create a new directory: extras/language_controls/

Put the .app packages for each updated product into this directory. Once this is ready, simply run:

cd extras
python update_langpacks.py

That should be it. Note that this tool will fail horribly if any of the teams change the locations that the various language files are stored in.

Also note that this tool should only be run against the en-US versions of these applications.

amo-validator's People

Contributors

almet avatar archaeopteryx avatar automatedtester avatar clouserw avatar cvan avatar diox avatar entequak avatar eviljeff avatar fox2mike avatar kewisch avatar kmaglione avatar kumar303 avatar kwierso avatar l-hedgehog avatar magopian avatar marceloandrader avatar mattbasta avatar mstriemer avatar muffinresearch avatar myrdd avatar nmaier avatar olivier-m avatar pyup-bot avatar rob--w avatar robhudson avatar rpl avatar sancus avatar wagnerand avatar wraithan avatar yohanboniface avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

amo-validator's Issues

[fx52] Show compatibility warning if an add-on uses nsISupportsArray

As part of bug 792209, nsISupportsArray is being deprecated. All instances of this interface should be flagged.

This is a compatibility warning, so the add-on should still be upgraded in this case. It should also appear as a warning in regular validations.

Message:

The nsISupportsArray interface is deprecated and is being replaced by nsIArray. See this bug report for more information.

Affected add-on: https://addons.mozilla.org/addon/pagesaver/

Release timing: Firefox 52 will be released on March 7th.

Double Multi Process warning if addon contains JAR

re: Extension is not marked as compatible with Multi Process
Example:
https://addons.mozilla.org/en-US/developers/addon/earthweb/file/457094/validation

Extension is not marked as compatible with Multi Process
chrome/Earth.jar/

Extension is not marked as compatible with Multi Process

Report deprecation warning for add-ons that use ctypes

We would like deprecate (and eventually block) add-on access to ctypes. I'm working with bsmedberg to compose a deprecation announcement.

We apparently can't block add-on access to ctypes at run-time (because Firefox uses ctypes itself). @jvillalobos says the AMO validator already flags ctypes add-ons for extra review. bsmedberg would like to expose those warnings to add-on developers and change the wording to mention ctypes deprecation.

def test_ctypes(self):

@andymckay

Bulk validation shows incorrect multiprocessCompatible warning

This was reported in the blog.

See, for example, version 3.0 of Addons Manager Hilite. install.rdf has the multiprocessCompatible flag set to true. The developer page for the add-on shows that it's compatible, and if I upload the file to the standalone validator and the compatibility validator, neither show any multiprocessCompatible warnings. However, the email the developer got points to this validation result that does show the incorrect warning. This apparently affected multiple add-ons.

Info Request attached to the wrong version

I rejected an addon. I needed to post additional comments which was done via "Request more information". Previously that was working as it should.

I noticed today that it was attached to the last passed version and not the current but rejected one.

Ref: https://addons.mozilla.org/en-US/editors/review/klamm-de-websuche-gutscheine

[fx51] Show compatibility error if an add-on uses onButtonClick

As part of bug 1167575, the behavior of onButtonClick changed. All instances of this function should be flagged.

This is a compatibility error, so the add-on shouldn't be upgraded in this case. It should also appear as a warning in regular validations.

Message:

The function onButtonClick is now asynchronous. For more information, please refer to this bug report.

Affected add-on: https://addons.mozilla.org/addon/imacros-for-firefox/

Release timing: Firefox 51 will be released on January 24th.

Fail on submission of cfx-packed SDK add-on

As SDK add-ons packed with cfx are broken in Firefox 44+ (in bootstrap.js due to changed let/const behavior), the validator needs to fail and give a meaningful error message to let developers know

  1. what's wrong
  2. how they can fix it.

Note that we should fail on new submissions, but compatibility tests should not be affected by this as published add-ons on AMO have been repacked to fix this issue.

Update of "Outdated version of Add-on SDK" notice

At the moment the warning states:

You are using version ******* of the Add-on SDK, which is outdated. Please upgrade to version 1.17 and repack your add-on

I personally alter it (via a script) to state:

You are using version ******* of the Add-on SDK, which is outdated. Please upgrade to version 1.17 or use JPM and repack your add-on.

The changes are or use JPM and a full stop at the end.

Update: Text updated subsequent to the comment by wagnerand

ECMAScript 6 Classes result in JavaScript Compile-Time Error

example:
https://addons.mozilla.org/en-US/editors/review/inbox-notifications
https://addons.mozilla.org/en-US/firefox/files/browse/440671/file/data/content.js#top

Code:

"use strict";

    console.log("content.js attached");

    class Message {
      constructor(entry) {
        this.entry = entry;
      }

      get id() {
        return this.entry.querySelector("id").textContent;
      }

      get subject() {
       return this.entry.querySelector("title").textContent;
      }

      get summary() {
        return this.entry.querySelector("summary").textContent;
      }

      get sender_name() {
       return this.entry.querySelector("author > name").textContent;
      }

      get sender_email() {
       return this.entry.querySelector("author > email").textContent;
      }

      toString() {
        return `[Message: "${this.subject}" From: ${this.sender_name} <${this.sender_email}>]`;
      }
    }

    class TitleMutator {
      constructor() {
        this.titleElem = document.getElementsByTagName('title')[0];
        this.origTitle = this.titleElem.textContent;
        this.unreadCount = 0;

        this.mutateTitle();
        this.observe();
      }

      get unreadCount() {
        return this._unreadCount;
      }

      set unreadCount(unread) {
        this._unreadCount = unread;
        this.mutateTitle();
      }

      get observer() {
        if (!this._observer) {
          this._observer = new MutationObserver(() => {
            this.origTitle = this.titleElem.textContent;
            this.mutateTitle();
          });
        }

        return this._observer;
      }

      observe() {
        this.observer.observe(this.titleElem, { characterData: true });
      }

      unobserve() {
        this.observer.disconnect();
      }

      mutateTitle() {
        this.unobserve();
        this.titleElem.textContent = (this.unreadCount == 0) ?
          this.origTitle :
          this.origTitle.replace(/^Inbox/, `Inbox (${this.unreadCount})`);
        this.observe();
      }
    }

    class MessageFetcher {
      constructor() {
        this.seenMessages = new Set();
        this.titleMutator = new TitleMutator();
        this.mainList = document.querySelector('[role="main"]');
        this.firstRun = true;
        this.mainList.addEventListener("click", e => {
          if (e.target.closest('[role="application"]')) {
            // Potentially marked an item read.
            setTimeout(() => this.refresh(), 3000);
          }
        })
      }

      localize(strings) {
        return new Promise(resolve => {
          self.port.once("localized", resolve);
          self.port.emit("localize", strings);
        });
      }

      getFeed() {
        return new Promise(resolve => {
          self.port.once("mailFeed", response => {
            let parser = new DOMParser();
            resolve(parser.parseFromString(response, "text/xml"));
          });
          let accountId = window.location.pathname.substr(3, 1) || 0;
          self.port.emit("getMailFeed", accountId);
        });
      }

      notify(messages) {
        if (messages.length) {
          let notification = {};

          if (messages.length == 1) {
            notification = {
              title: ["new_message", messages[0].sender_name],
              body: messages[0].subject
            };
          } else {
            let senders = new Set(messages.map(e => e.sender_name));
            notification = {
              title: ["new_messages", messages.length],
              body: Array.from(senders).join(', ')
            };
          }
          if (!document.hasFocus()) {
            self.port.emit("notify", notification);
          } else {
            console.log("Focused, so not notifying:", JSON.stringify(notification));
          }
        }
      }

      refresh() {
        console.log("refreshing");
        return this.getFeed().then(feed => {
          console.log("got feed");
          let unread = this.titleMutator.unreadCount = feed.querySelector("fullcount").textContent;
          let newMessages = [];
          for (let entry of feed.querySelectorAll("entry")) {
            let message = new Message(entry);
            if (!this.firstRun && !this.seenMessages.has(message.id)) {
              newMessages.push(message);
            }
            this.seenMessages.add(message.id);
          }

          this.firstRun = false;

          console.log(
            "Unread:", unread,
            "New:", newMessages.length,
            "Cached:", this.seenMessages.size);

          this.notify(newMessages);

          return { unread: unread, newMessages: newMessages };
        });
      }

      get observer() {
        if (!this._observer) {
          this._observer = new MutationObserver(mutations => {
            let listitemAdded = () => {
              for (let mutation of mutations) {
                if (mutation.type == "characterData") {
                  if (!mutation.target.parentNode.closest('[contenteditable]')) {
                    return true
                  }
                }

                for (let node of mutation.addedNodes) {
                  if (node.getAttribute('role') == 'listitem' ||
                      node.getAttribute('role') == 'list') {
                    return true;
                  }
                }
              }

              return false;
            };

            if (listitemAdded()) {
              console.log("list item added");
              this.refresh();
            }
          });
        }

        return this._observer;
      }

      connect() {
        // We can be more economical and listen for DOM mutations
        // setInterval(refreshMail, 5000);
        this.observer.observe(this.mainList,
          { characterData: true, subtree: true, childList: true });
      }

      disconnect() {
        this.observer.disconnect();
      }
    }

    const messageFetcher = new MessageFetcher();
    messageFetcher.refresh();
    messageFetcher.connect();

Duplicated warnings at add-on validation

Steps to reproduce:

  1. Try to submit the following add-on:
    testaddon.zip
  2. Select “See full validation report”

Expected results:
Each warning is specified only a single time.

Actual results:
A few warnings are duplicated.

Additional notes:

  • This issue reproduces on AMO-dev, AMO-stage and AMO-production using Firefox 50.0a1 (2016-06-21) under Windows 10 64-bit.
  • Please see the attached screenshots for this issue:
    2016-06-22_1320
    2016-06-22_1321
    2016-06-22_1323
    2016-06-22_1530

Moved from: mozilla/addons-linter#768

AMO Validation does not work correctly when `async / await` are used.

I've got JavaScript Compile-Time Error warnings when I uploaded my add-on to AMO.
2 types of messages.

A compile-time error in the JavaScript halted validation of that file.

Message: missing ; before statement

A compile-time error in the JavaScript halted validation of that file.

Message: invalid arrow-function arguments (parentheses around the arrow-function may help)

All of my JS files are warned, and I use async / await in them.

My source and warnings.
https://addons.mozilla.org/en-US/firefox/files/browse/537463/

PS I'm also noticed about em:hasEmbeddedWebExtension.

Validator and Highlighter miss .htm files

Example:
https://addons.mozilla.org/en-US/firefox/files/browse/514781/file/popup.htm#top

Above file is .htm and also includes <script> tags
(I am keeping a copy of the addon, in case it gets deleted)

The Syntax Highlighter does not activate on that file.
The validator may be !? working properly since the JS in that file is somehow obfuscated.

[fx52] Show compatibility error if an add-on uses mozDash or mozDashOffset

As part of bug 931389, mozDash and mozDashOffset are no longer supported. All instances of these properties should be flagged.

This is a compatibility error, so the add-on shouldn't be upgraded in this case. It should also appear as a warning in regular validations.

Message:

The mozDash and mozDashOffset properties are no longer supported. You can use setLineDash() instead.

Affected add-on: https://addons.mozilla.org/addon/zotfile/

Release timing: Firefox 52 will be released on March 7th.

Validator misflags png as binary when another binary file exists

https://addons.mozilla.org/en-US/developers/addon/flash-debugger/file/421089/validation

Flagged file extensions found.

Warning: Files whose names end with flagged extensions have been found in the add-on.

The extension of these files are flagged because they usually identify binary components. 
Please see http://addons.mozilla.org/developers/docs/policies/reviews#section-binary for 
more information on the binary content review process.

data/flashfirebug.swf
    data/html/images/themes/default/inspector/UIComponents/VolumeBar.png

The png file is not a binary file, nor should it be flagged.

Tab stops change not working

It was a useful feature and it has been a while that Tab stops change is not working ie changing it has no effect at all.

[fx51] Show compatibility warning if an add-on uses setAndFetchFaviconForPage or replaceFaviconDataFromDataURL

As part of bug 1227289, the functions setAndFetchFaviconForPage and replaceFaviconDataFromDataURL have changed their arguments and default behavior. All instances of these should be flagged.

This is a compatibility warning, so the add-on should still be upgraded in this case. It should also appear as a warning in regular validations.

Message:

setAndFetchFaviconForPage and replaceFaviconDataFromDataURL now default to using a null principal for security reasons. An appropriate principal should be passed if different behavior is required. For more information, please refer to this bug report.

Affected add-on: https://addons.mozilla.org/addon/xmarks-sync/

Release timing: Firefox 51 will be released on January 24th.

[fx53] Show compatibility error if an add-on uses `getURIForKeyword`

As part of bug 1329926, the getURIForKeyword function has been removed. All instances of this function should be flagged.

This is a compatibility error, so the add-on shouldn't be upgraded in this case. It should also appear as a warning in regular validations.

Message:

The getURIForKeyword function was removed. You can use PlacesUtils.keywords.fetch instead. See this document for more information.

Affected add-on: https://addons.mozilla.org/addon/context-search-x/

[fx53] Show compatibility error if an add-on uses certain `nsIX509CertDB` methods

As part of bug 857627, a number of nsIX509CertDB methods were removed or changed. Removed: findCertByNickname, findEmailEncryptionCert, findEmailSigningCert, changed: addCert. All instances of these methods should be flagged.

This is a compatibility error, so the add-on shouldn't be upgraded in this case. It should also appear as a warning in regular validations.

Message:

The nsIX509CertDB interface was changed so it no longer exposes the certificate nickname. See this bug report for more information.

Affected add-on: https://addons.mozilla.org/addon/xml-digital-signature-tool/

Inconsistent priority for install.rdf vs manifest.json

I have manifest.json for Chrome and install.rdf for Firefox and I got the following validation error.

validation-error

No Mozilla products listed as target applications
Error: None of the target applications listed in the manifest are supported Mozilla products. At least one official Mozilla product must be supported for inclusion on addons.mozilla.org.

See https://addons.mozilla.org/firefox/pages/appversions/ for more information on supported target applications on AMO.

manifest.json

In #386 support was added for manifest.json

In amo-validator/tests/helper.py:

        if 'install.rdf' in package:
            err.save_resource('has_install_rdf', True)
            rdf_data = package.read('install.rdf')
            install_rdf = RDFParser(err, rdf_data)
            err.save_resource('install_rdf', install_rdf)
        elif 'manifest.json' in package:
            err.save_resource('has_manifest_json', True)
            manifest_data = package.read('manifest.json')
            manifest_json = ManifestJsonParser(err, manifest_data)
            err.save_resource('install_rdf', manifest_json)

In amo-validator/validator/testcases/targetapplication.py the order is reversed:

    if manifest_json:
        applications = manifest_json.get_applications()
        manifest_file = 'manifest.json'
    elif install_rdf:
        applications = install_rdf.get_applications()
        manifest_file = 'install.rdf'

Which is the correct order? Does install.rdf take precedence over manifest.json? Are you going to validate both manifest files?

I will be adding an applications entry to my manifest.json (if chrome doesn't complain about it), but this inconsistency will cause problems for developers in the future.

403 Forbidden when trying to view raw file

Quite regularly, trying the **Download ******* links at the bottom (ie view) results in 403 Forbidden

Example:
https://addons.cdn.mozilla.net/en-US/firefox/files/browse/459606/file-serve/modules/BrandThunderUtils.jsm?token=c568f0b0-e701-4990-a960-65cefaa3362a

[fx51] Show compatibility error if an add-on uses mozVisibilityState or mozHidden

As part of bug 812701, the mozVisibilityState and mozHidden properties have been unprefixed. All instances of these should be flagged.

This is a compatibility error, so the add-on shouldn't be upgraded in this case. It should also appear as a warning in regular validations.

Message:

The mozVisibilityState and mozHidden properties are no longer prefixed, so you should use visibilityState and hidden instead. For more information, please refer to this bug report.

Affected add-on: https://addons.mozilla.org/addon/scrollbar-search-highlighter/

Release timing: Firefox 51 will be released on January 24th.

Validator ineffective in some cases (shows nothing)

There are developers who copy/paste GreaseMoneky scripts into an addon.

It seems validator (as well as the Olympia for displaying the review) miss most issues in such cases.
It might be due to wild-card usages in GM include/exclude.

Example - validator shows nothing while there are eval(), createElement('script'), innerHTML etc
https://addons.mozilla.org/en-US/developers/addon/enhanced-rt/file/488096/validation

Review: (Syntax Highlight also has issues)
https://addons.mozilla.org/en-US/firefox/files/browse/488096/file/Enhanced%20RT.user.js#top

[fx51] Show compatibility error if an add-on uses BrowserOpenNewTabOrWindow

As part of bug 528005, the BrowserOpenNewTabOrWindow function has been removed. All instances of this function should be flagged.

This is a compatibility error, so the add-on shouldn't be upgraded in this case. It should also appear as a warning in regular validations.

Message:

The function BrowserOpenNewTabOrWindow has been removed. You can use BrowserOpenTab instead, but its behavior is not identical. For more information, please refer to this bug report.

Affected add-on: https://addons.mozilla.org/addon/tab-tree/

Release timing: Firefox 51 will be released on January 24th.

[fx53] Show compatibility error if an add-on uses `_openURIInNewTab`

As part of bug 1147911, the _openURIInNewTab function changed the arguments it takes. This function is often monkey-patched by tab add-ons. All instances of this function should be flagged.

This is a compatibility error, so the add-on shouldn't be upgraded in this case. It should also appear as a warning in regular validations.

Message:

The _openURIInNewTab function was changed and now requires an nsIURI for the referrer. See this bug report for more information.

Affected add-on: https://addons.mozilla.org/addon/load-tabs-progressively-fixed/

False JavaScript Compile-Time Error

Example:

https://addons.mozilla.org/en-US/firefox/files/browse/459606/file/modules/BrandThunderUtils.jsm#top

JavaScript Compile-Time Error

A compile-time error in the JavaScript halted validation of that file.

Message: missing ] after element list
modules/BrandThunderUtils.jsm
8
9
10
Cu.import("resource://gre/modules/AddonManager.jsm");
try {
Components.utils.import("resource:///modules/NewTabURL.jsm");

Actual code:

var EXPORTED_SYMBOLS = ["BrandThunderUtils"];

const {classes: Cc, interfaces: Ci, utils: Cu} = Components;
Cu.import("resource://gre/modules/XPCOMUtils.jsm");
Cu.import("resource://gre/modules/Services.jsm");
Cu.import("resource://gre/modules/NetUtil.jsm");
Cu.import("resource://gre/modules/LightweightThemeManager.jsm");
Cu.import("resource://gre/modules/AddonManager.jsm");
try {
  Components.utils.import("resource:///modules/NewTabURL.jsm");
} catch (e) {}

Blank search no longer shows the admin flagged addons

I have noticed (for a while) that using the search button with blank query on the queue page no longer shows the admin flagged addons.

It seems that the problems is with searching= parameter

For example .....
Shows admin flagged:
https://addons.mozilla.org/en-US/editors/queue/nominated?searching=True&text_query=&admin_review=1&application_id=&max_version=&waiting_time_days=#review-actions

Doesn't show admin flagged:
https://addons.mozilla.org/en-US/editors/queue/nominated?searching=&text_query=&admin_review=&application_id=&max_version=&waiting_time_days=

Changing the searching=& to searching=true& fixes it.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.