Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
/* exported run_test */
const {Log} = require("lib/classes/log");
const log = new Log();
const {JSMService} = require("bootstrap/api/services/jsm-service");
const jsmService = new JSMService(Cu);
const mozServices = jsmService.getServices();
const prefsService = mozServices.prefs;
const {
NetworkPredictionEnabledSetting,
} = require("bootstrap/api/privacy/network-prediction-enabled");
const { PrivacyApi } = require("bootstrap/api/privacy/privacy.module");
const { PrefBranch } = require("bootstrap/api/storage/pref-branch");
const { XPConnectService } = require("bootstrap/api/services/xpconnect-service");
function createPrivacyApi() {
const xpconnectService = new XPConnectService();
const rootPrefBranch = new PrefBranch(
Ci,
prefsService,
xpconnectService,
/* exported run_test */
const {FileService} = require("bootstrap/api/services/file-service");
const {JSMService} = require("bootstrap/api/services/jsm-service");
const {XPConnectService} = require("bootstrap/api/services/xpconnect-service");
const {JsonStorage} = require("bootstrap/api/storage/json-storage");
const {PrefBranch} = require("bootstrap/api/storage/pref-branch");
const {Storage} = require("bootstrap/api/storage/storage.module");
const {SyncLocalStorageArea} = require("bootstrap/api/storage/sync-local-storage-area");
const {Log} = require("lib/classes/log");
const log = new Log();
const xpconnectService = new XPConnectService();
const jsmService = new JSMService(Cu);
const mozFileUtils = jsmService.getFileUtils();
const mozServices = jsmService.getServices();
const rpPrefBranch = new PrefBranch(
Ci,
mozServices.prefs,
xpconnectService,
"extensions.requestpolicy."
);
const fileService = new FileService(xpconnectService, mozFileUtils);
const jsonStorage = new JsonStorage(fileService);
const syncLocalStorageArea = new SyncLocalStorageArea(
mozServices.prefs, rpPrefBranch, jsonStorage
);
function createStorageApi() {
return new Storage(log, syncLocalStorageArea, rpPrefBranch);
const jsmService = whenLegacy(() => new JSMService(Cu));
const xpconnectService = whenLegacy(() => new XPConnectService());