Bug 1252346 - Some DevTools files missing Services. r=ochameau
MozReview-Commit-ID: F1SjhiXNZSj
--- a/devtools/client/framework/target.js
+++ b/devtools/client/framework/target.js
@@ -4,16 +4,17 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
"use strict";
const { Ci, Cu } = require("chrome");
const promise = require("promise");
const EventEmitter = require("devtools/shared/event-emitter");
+const Services = require("Services");
Cu.import("resource://gre/modules/XPCOMUtils.jsm");
loader.lazyRequireGetter(this, "DebuggerServer", "devtools/server/main", true);
loader.lazyRequireGetter(this, "DebuggerClient",
"devtools/shared/client/main", true);
const targets = new WeakMap();
const promiseTargets = new WeakMap();
--- a/devtools/client/netmonitor/har/toolbox-overlay.js
+++ b/devtools/client/netmonitor/har/toolbox-overlay.js
@@ -1,14 +1,15 @@
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
"use strict";
const { Cu, Ci } = require("chrome");
+const Services = require("Services");
loader.lazyRequireGetter(this, "HarAutomation", "devtools/client/netmonitor/har/har-automation", true);
// Map of all created overlays. There is always one instance of
// an overlay per Toolbox instance (i.e. one per browser tab).
const overlays = new WeakMap();
/**
--- a/devtools/client/webide/modules/simulators.js
+++ b/devtools/client/webide/modules/simulators.js
@@ -7,16 +7,17 @@ const { AddonManager } = Cu.import("reso
const { Task } = Cu.import("resource://gre/modules/Task.jsm", {});
loader.lazyRequireGetter(this, "ConnectionManager", "devtools/shared/client/connection-manager", true);
loader.lazyRequireGetter(this, "AddonSimulatorProcess", "devtools/client/webide/modules/simulator-process", true);
loader.lazyRequireGetter(this, "OldAddonSimulatorProcess", "devtools/client/webide/modules/simulator-process", true);
loader.lazyRequireGetter(this, "CustomSimulatorProcess", "devtools/client/webide/modules/simulator-process", true);
const asyncStorage = require("devtools/shared/async-storage");
const EventEmitter = require("devtools/shared/event-emitter");
const promise = require("promise");
+const Services = require("Services");
const SimulatorRegExp = new RegExp(Services.prefs.getCharPref("devtools.webide.simulatorAddonRegExp"));
const LocaleCompare = (a, b) => {
return a.name.toLowerCase().localeCompare(b.name.toLowerCase());
};
var Simulators = {
--- a/devtools/shared/touch/simulator.js
+++ b/devtools/shared/touch/simulator.js
@@ -1,15 +1,16 @@
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
"use strict";
var { Ci } = require("chrome");
var promise = require("promise");
+var Services = require("Services");
const FRAME_SCRIPT =
"resource://devtools/shared/touch/simulator-content.js";
var trackedBrowsers = new WeakMap();
var savedTouchEventsEnabled =
Services.prefs.getIntPref("dom.w3c_touch_events.enabled");