tor-browser

The Tor Browser
git clone https://git.dasho.dev/tor-browser.git
Log | Files | Refs | README | LICENSE

filter.py (1106B)


      1 # This Source Code Form is subject to the terms of the Mozilla Public
      2 # License, v. 2.0. If a copy of the MPL was not distributed with this
      3 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
      4 
      5 
      6 def test(mod, path, entity=None):
      7    # ignore anything but Firefox
      8    if mod not in (
      9        "netwerk",
     10        "dom",
     11        "toolkit",
     12        "security/manager",
     13        "devtools/client",
     14        "devtools/shared",
     15        "devtools/startup",
     16        "browser",
     17        "extensions/spellcheck",
     18        "other-licenses/branding/firefox",
     19        "browser/branding/official",
     20        "services/sync",
     21    ):
     22        return "ignore"
     23    if mod not in ("browser", "extensions/spellcheck"):
     24        # we only have exceptions for browser and extensions/spellcheck
     25        return "error"
     26    if entity is None:
     27        # the only files to ignore are spell checkers
     28        if mod == "extensions/spellcheck":
     29            return "ignore"
     30        return "error"
     31    if mod == "extensions/spellcheck":
     32        # l10n ships en-US dictionary or something, do compare
     33        return "error"
     34    return "error"