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/. */
7 // Stopgap module until we can land bug 1536862 and remove this temporary file
9 const {Services} = ChromeUtils.import("resource://gre/modules/Services.jsm");
10 const {XPCOMUtils} = ChromeUtils.import("resource://gre/modules/XPCOMUtils.jsm");
12 ChromeUtils.defineModuleGetter(this, "RemoteAgent",
13 "chrome://remote/content/RemoteAgent.jsm");
15 const RemoteAgentFactory = {
16 createInstance(outer, iid) {
18 throw Cr.NS_ERROR_NO_AGGREGATION;
20 // we can't use Preferences.jsm before first paint
21 if (!Services.prefs.getBoolPref("remote.enabled")) {
25 return RemoteAgent.QueryInterface(iid);
29 function RemoteAgentComponent() {}
31 RemoteAgentComponent.prototype = {
32 classDescription: "Remote Agent",
33 classID: Components.ID("{8f685a9d-8181-46d6-a71d-869289099c6d}"),
34 contractID: "@mozilla.org/remote/agent",
35 _xpcom_factory: RemoteAgentFactory, /* eslint-disable-line */
38 this.NSGetFactory = XPCOMUtils.generateNSGetFactory([RemoteAgentComponent]);