tor-browser

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

preference.js (1308B)


      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  Arg,
      8  RetVal,
      9  generateActorSpec,
     10 } = require("resource://devtools/shared/protocol.js");
     11 
     12 const preferenceSpec = generateActorSpec({
     13  typeName: "preference",
     14 
     15  methods: {
     16    getTraits: {
     17      request: {},
     18      response: { traits: RetVal("json") },
     19    },
     20    getBoolPref: {
     21      request: { value: Arg(0) },
     22      response: { value: RetVal("boolean") },
     23    },
     24    getCharPref: {
     25      request: { value: Arg(0) },
     26      response: { value: RetVal("string") },
     27    },
     28    getIntPref: {
     29      request: { value: Arg(0) },
     30      response: { value: RetVal("number") },
     31    },
     32    getAllPrefs: {
     33      request: {},
     34      response: { value: RetVal("json") },
     35    },
     36    setBoolPref: {
     37      request: { name: Arg(0), value: Arg(1) },
     38      response: {},
     39    },
     40    setCharPref: {
     41      request: { name: Arg(0), value: Arg(1) },
     42      response: {},
     43    },
     44    setIntPref: {
     45      request: { name: Arg(0), value: Arg(1) },
     46      response: {},
     47    },
     48    clearUserPref: {
     49      request: { name: Arg(0) },
     50      response: {},
     51    },
     52  },
     53 });
     54 
     55 exports.preferenceSpec = preferenceSpec;