Bug 1366023 - Explicitly import Services.jsm in a few content scripts. r=Gijs draft
authorAndrew McCreight <continuation@gmail.com>
Fri, 12 May 2017 15:57:53 -0700
changeset 580545 833b1a7a12f2dce06a204b2cd67d656afafe02df
parent 580544 dc1cc4c7ca2be8a8097614ff7e7c91e6ab456eee
child 629336 fa555b33897cfb14cc6316f54526df3869a22e57
push id59612
push userbmo:continuation@gmail.com
push dateThu, 18 May 2017 18:20:50 +0000
reviewersGijs
bugs1366023
milestone55.0a1
Bug 1366023 - Explicitly import Services.jsm in a few content scripts. r=Gijs MozReview-Commit-ID: 5HS9tXk3oa9
testing/mochitest/tests/SimpleTest/AsyncUtilsContent.js
testing/specialpowers/content/specialpowers.js
toolkit/modules/addons/WebNavigationContent.js
--- a/testing/mochitest/tests/SimpleTest/AsyncUtilsContent.js
+++ b/testing/mochitest/tests/SimpleTest/AsyncUtilsContent.js
@@ -1,13 +1,15 @@
 /*
  * This code is used for handling synthesizeMouse in a content process.
  * Generally it just delegates to EventUtils.js.
  */
 
+Components.utils.import("resource://gre/modules/Services.jsm");
+
 // Set up a dummy environment so that EventUtils works. We need to be careful to
 // pass a window object into each EventUtils method we call rather than having
 // it rely on the |window| global.
 var EventUtils = {};
 EventUtils.window = {};
 EventUtils.parent = EventUtils.window;
 EventUtils._EU_Ci = Components.interfaces;
 EventUtils._EU_Cc = Components.classes;
--- a/testing/specialpowers/content/specialpowers.js
+++ b/testing/specialpowers/content/specialpowers.js
@@ -1,15 +1,17 @@
 /* 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/. */
 /* This code is loaded in every child process that is started by mochitest in
  * order to be used as a replacement for UniversalXPConnect
  */
 
+Components.utils.import("resource://gre/modules/Services.jsm");
+
 function SpecialPowers(window) {
   this.window = Components.utils.getWeakReference(window);
   this._windowID = window.QueryInterface(Components.interfaces.nsIInterfaceRequestor)
                          .getInterface(Components.interfaces.nsIDOMWindowUtils)
                          .currentInnerWindowID;
   this._encounteredCrashDumpFiles = [];
   this._unexpectedCrashDumpFiles = { };
   this._crashDumpDir = null;
--- a/toolkit/modules/addons/WebNavigationContent.js
+++ b/toolkit/modules/addons/WebNavigationContent.js
@@ -1,15 +1,16 @@
 "use strict";
 
 /* globals docShell */
 
 var Ci = Components.interfaces;
 
 Components.utils.import("resource://gre/modules/XPCOMUtils.jsm");
+Components.utils.import("resource://gre/modules/Services.jsm");
 
 XPCOMUtils.defineLazyModuleGetter(this, "WebNavigationFrames",
                                   "resource://gre/modules/WebNavigationFrames.jsm");
 
 function loadListener(event) {
   let document = event.target;
   let window = document.defaultView;
   let url = document.documentURI;