Console.jsm 1.0 KB

123456789101112131415161718192021222324252627282930313233343536
  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/. */
  4. "use strict";
  5. /**
  6. * This file only exists to support add-ons which import this module at a
  7. * specific path.
  8. */
  9. const Cu = Components.utils;
  10. const { Services } = Cu.import("resource://gre/modules/Services.jsm", {});
  11. const WARNING_PREF = "devtools.migration.warnings";
  12. if (Services.prefs.getBoolPref(WARNING_PREF)) {
  13. const { Deprecated } = Cu.import("resource://gre/modules/Deprecated.jsm", {});
  14. Deprecated.warning("This path to Console.jsm is deprecated. Please use " +
  15. "Cu.import(\"resource://gre/modules/Console.jsm\") " +
  16. "to load this module.",
  17. "https://bugzil.la/912121");
  18. }
  19. this.EXPORTED_SYMBOLS = [
  20. "console",
  21. "ConsoleAPI"
  22. ];
  23. const module =
  24. Cu.import("resource://gre/modules/Console.jsm", {});
  25. for (let symbol of this.EXPORTED_SYMBOLS) {
  26. this[symbol] = module[symbol];
  27. }