User:Mconnor/JSONBlocklist

From MozillaWiki
Jump to: navigation, search

This is a straight port of the example at Extension_Blocklisting:Code_Design

I'd probably strip the implicit behaviour cases for simplification.

 {
  _v: 1,
  extensions: [
    "item_1@domain": [
     {
       minVersion: "1.0",
       maxVersion: "2.0.*",
       severity: 3,
       apps: {
         "{ec8030f7-c20a-464f-9b0e-13a3a9e97384}": {
           ranges: [
             { minVersion: "1.5", maxVersion: "1.5.*"},
             { minVersion: "1.7", maxVersion: "1.7.*"}
           ]
         },
         "{ec8030f7-c20a-464f-9b0e-13a3a9e97384}": {
           ranges: [
             { minVersion: "1.8", maxVersion: "1.8.*"}
           ]
         },
       },
       fixup: {
         prefs: ["test.pref1","test.prefBranch2."],
         search: ["BadEngine1"],
         certs:  ["EvilCA"],
       }
     },
     {
       minVersion: "3.0",
       maxVersion: "3.0.*",
       severity: 3,
       apps: {
         "{ec8030f7-c20a-464f-9b0e-13a3a9e97384}": {
           ranges: [
             { minVersion: "1.5", maxVersion: "1.5.*"}
           ]
         },
         "toolkit@mozilla.org": {
           ranges: [
             { minVersion: "1.8", maxVersion: "1.8.*"}
           ]
         },
       },
       fixup: {
         prefs: ["test.pref1","test.prefBranch2."],
         search: ["BadEngine1"],
       }
     },
    ]
    "item_2@domain": [
      {
        minVersion: "3.1",
        maxVersion: "4.*"
      }
    ],
    "item_3@domain": [
      {
        apps: {
         "{ec8030f7-c20a-464f-9b0e-13a3a9e97384}": {
           ranges: [
             { minVersion: "1.5", maxVersion: "1.5.*"},
             { minVersion: "1.7", maxVersion: "1.7.*"}
           ]
         }
        }
      }
    ],
    "item_4@domain": [
      {
        apps: {
          "all": {
            ranges: [
              { minVersion: "1.5", maxVersion: "1.5.*"}
            ]
          }
        }
      }
    ],
    "item_5@domain": [
      {}
    ],
    "item_6@domain": [
      os: ["WINNT","Darwin"]
    ]
  ],
  plugins: [
    {
      matches: {
        "name": "some plugin",
        "description": "1[.]2[.]3",
        "filename":  ".*\.exe"
      }
    },
    {
      os: ["Linux"],
      xpcomabi: ["x86_64-gcc3"],
      matches: {
        "name": "some other plugin",
        "description": "5[.]6[.]7",
        "filename":  "npplugin*\.dll"
      }
    },
    {
      matches: {
        "name": "some bad plugin",
      },
      apps: {
        "{ec8030f7-c20a-464f-9b0e-13a3a9e97384}": {
          ranges: [
            { minVersion: "1.5", maxVersion: "1.5.*"}
          ]
        }
      },
      severity: 2
    },
  ],
 }