tor-browser

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

compatibility.js (1736B)


      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 "use strict";
      6 
      7 const {
      8  Arg,
      9  RetVal,
     10  generateActorSpec,
     11  types,
     12 } = require("resource://devtools/shared/protocol.js");
     13 
     14 types.addDictType("browsertype", {
     15  id: "string",
     16  name: "string",
     17  version: "string",
     18  status: "string",
     19 });
     20 
     21 types.addDictType("compatibilityissues", {
     22  type: "string",
     23  property: "string",
     24  aliases: "nullable:array:string",
     25  url: "nullable:string",
     26  specUrl: "nullable:string",
     27  deprecated: "boolean",
     28  experimental: "boolean",
     29  unsupportedBrowsers: "array:browsertype",
     30 });
     31 
     32 types.addDictType("declaration", {
     33  name: "string",
     34  value: "string",
     35 });
     36 
     37 const compatibilitySpec = generateActorSpec({
     38  typeName: "compatibility",
     39 
     40  methods: {
     41    // While not being used on the client at the moment, keep this method in case
     42    // we need traits again to support backwards compatibility for the Compatibility
     43    // actor.
     44    getTraits: {
     45      request: {},
     46      response: { traits: RetVal("json") },
     47    },
     48    getCSSDeclarationBlockIssues: {
     49      request: {
     50        domRulesDeclarations: Arg(0, "array:array:declaration"),
     51        targetBrowsers: Arg(1, "array:browsertype"),
     52      },
     53      response: {
     54        compatibilityIssues: RetVal("array:array:compatibilityissues"),
     55      },
     56    },
     57    getNodeCssIssues: {
     58      request: {
     59        node: Arg(0, "domnode"),
     60        targetBrowsers: Arg(1, "array:browsertype"),
     61      },
     62      response: {
     63        compatibilityIssues: RetVal("array:compatibilityissues"),
     64      },
     65    },
     66  },
     67 });
     68 
     69 exports.compatibilitySpec = compatibilitySpec;