Bug 1442006 - WIP - Proof of concept for introducing XPCOMUtils and Services globals into chromeGlobals and out of browser.js
This is just removing the reference from a single script - if we like this approach we'd want to remove it from
all window scripts in tree as well
MozReview-Commit-ID: BcZroeOJbVR
--- a/browser/base/content/browser.js
+++ b/browser/base/content/browser.js
@@ -1,17 +1,15 @@
/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*-
* 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/. */
/* eslint-env mozilla/browser-window */
-ChromeUtils.import("resource://gre/modules/XPCOMUtils.jsm");
-ChromeUtils.import("resource://gre/modules/Services.jsm");
ChromeUtils.import("resource://gre/modules/AppConstants.jsm");
ChromeUtils.import("resource://gre/modules/NotificationDB.jsm");
const {WebExtensionPolicy} = Cu.getGlobalForObject(Services);
// lazy module getters
XPCOMUtils.defineLazyModuleGetters(this, {
--- a/toolkit/content/chromeGlobals.js
+++ b/toolkit/content/chromeGlobals.js
@@ -1,12 +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/. */
+ChromeUtils.import("resource://gre/modules/Services.jsm");
+ChromeUtils.import("resource://gre/modules/XPCOMUtils.jsm");
+
function closeWindow(aClose, aPromptFunction) {
let { AppConstants } = ChromeUtils.import("resource://gre/modules/AppConstants.jsm", {});
// Closing the last window doesn't quit the application on OS X.
if (AppConstants.platform != "macosx") {
var windowCount = 0;
var e = Services.wm.getEnumerator(null);