tor-browser

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

watcher.js (2586B)


      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 "use strict";
      5 
      6 const {
      7  generateActorSpec,
      8  Arg,
      9  RetVal,
     10 } = require("resource://devtools/shared/protocol.js");
     11 
     12 const watcherSpecPrototype = {
     13  typeName: "watcher",
     14 
     15  methods: {
     16    watchTargets: {
     17      request: {
     18        targetType: Arg(0, "string"),
     19      },
     20      response: {},
     21    },
     22 
     23    unwatchTargets: {
     24      request: {
     25        targetType: Arg(0, "string"),
     26        options: Arg(1, "nullable:json"),
     27      },
     28      oneway: true,
     29    },
     30 
     31    getParentBrowsingContextID: {
     32      request: {
     33        browsingContextID: Arg(0, "number"),
     34      },
     35      response: {
     36        browsingContextID: RetVal("nullable:number"),
     37      },
     38    },
     39 
     40    watchResources: {
     41      request: {
     42        resourceTypes: Arg(0, "array:string"),
     43      },
     44      response: {},
     45    },
     46 
     47    unwatchResources: {
     48      request: {
     49        resourceTypes: Arg(0, "array:string"),
     50      },
     51      oneway: true,
     52    },
     53 
     54    clearResources: {
     55      request: {
     56        resourceTypes: Arg(0, "array:string"),
     57      },
     58      oneway: true,
     59    },
     60 
     61    getNetworkParentActor: {
     62      request: {},
     63      response: {
     64        network: RetVal("networkParent"),
     65      },
     66    },
     67 
     68    getBlackboxingActor: {
     69      request: {},
     70      response: {
     71        blackboxing: RetVal("blackboxing"),
     72      },
     73    },
     74 
     75    getBreakpointListActor: {
     76      request: {},
     77      response: {
     78        breakpointList: RetVal("breakpoint-list"),
     79      },
     80    },
     81 
     82    getTargetConfigurationActor: {
     83      request: {},
     84      response: {
     85        configuration: RetVal("target-configuration"),
     86      },
     87    },
     88 
     89    getThreadConfigurationActor: {
     90      request: {},
     91      response: {
     92        configuration: RetVal("thread-configuration"),
     93      },
     94    },
     95  },
     96 
     97  events: {
     98    "target-available-form": {
     99      type: "target-available-form",
    100      target: Arg(0, "json"),
    101    },
    102    "target-destroyed-form": {
    103      type: "target-destroyed-form",
    104      target: Arg(0, "json"),
    105      options: Arg(1, "nullable:json"),
    106    },
    107 
    108    "resources-available-array": {
    109      type: "resources-available-array",
    110      array: Arg(0, "array:json"),
    111    },
    112    "resources-destroyed-array": {
    113      type: "resources-destroyed-array",
    114      array: Arg(0, "array:json"),
    115    },
    116    "resources-updated-array": {
    117      type: "resources-updated-array",
    118      array: Arg(0, "array:json"),
    119    },
    120  },
    121 };
    122 
    123 exports.watcherSpec = generateActorSpec(watcherSpecPrototype);